Module: Canon::RSpecMatchers

Defined in:
lib/canon/rspec_matchers.rb

Defined Under Namespace

Classes: SerializationMatcher

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure {|Canon::Config.configure| ... } ⇒ Object



17
18
19
# File 'lib/canon/rspec_matchers.rb', line 17

def configure
  yield Canon::Config.configure
end

.htmlObject



30
31
32
# File 'lib/canon/rspec_matchers.rb', line 30

def html
  Canon::Config.instance.html
end

.jsonObject



34
35
36
# File 'lib/canon/rspec_matchers.rb', line 34

def json
  Canon::Config.instance.json
end

.reset_configObject



21
22
23
# File 'lib/canon/rspec_matchers.rb', line 21

def reset_config
  Canon::Config.reset!
end

.xmlObject

Delegate configuration getters to Canon::Config



26
27
28
# File 'lib/canon/rspec_matchers.rb', line 26

def xml
  Canon::Config.instance.xml
end

.yamlObject



38
39
40
# File 'lib/canon/rspec_matchers.rb', line 38

def yaml
  Canon::Config.instance.yaml
end

Instance Method Details

#be_analogous_with(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



297
298
299
300
301
302
303
304
# File 'lib/canon/rspec_matchers.rb', line 297

def be_analogous_with(expected, match_profile: nil, match: nil,
                     preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :xml,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



360
361
362
363
364
365
366
367
# File 'lib/canon/rspec_matchers.rb', line 360

def be_equivalent_to(expected, match_profile: nil, match: nil,
                     preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, nil,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_html4_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



342
343
344
345
346
347
348
349
# File 'lib/canon/rspec_matchers.rb', line 342

def be_html4_equivalent_to(expected, match_profile: nil, match: nil,
                          preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :html4,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_html5_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



351
352
353
354
355
356
357
358
# File 'lib/canon/rspec_matchers.rb', line 351

def be_html5_equivalent_to(expected, match_profile: nil, match: nil,
                          preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :html5,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_html_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



333
334
335
336
337
338
339
340
# File 'lib/canon/rspec_matchers.rb', line 333

def be_html_equivalent_to(expected, match_profile: nil, match: nil,
                         preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :html,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_json_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



324
325
326
327
328
329
330
331
# File 'lib/canon/rspec_matchers.rb', line 324

def be_json_equivalent_to(expected, match_profile: nil, match: nil,
                          preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :json,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_serialization_equivalent_to(expected, format: :xml, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object

Matcher methods



287
288
289
290
291
292
293
294
295
# File 'lib/canon/rspec_matchers.rb', line 287

def be_serialization_equivalent_to(expected, format: :xml,
                                  match_profile: nil, match: nil,
                                  preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, format,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_string_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



369
370
371
372
373
374
375
376
# File 'lib/canon/rspec_matchers.rb', line 369

def be_string_equivalent_to(expected, match_profile: nil, match: nil,
                             preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :string,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_xml_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



306
307
308
309
310
311
312
313
# File 'lib/canon/rspec_matchers.rb', line 306

def be_xml_equivalent_to(expected, match_profile: nil, match: nil,
                        preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :xml,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end

#be_yaml_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object



315
316
317
318
319
320
321
322
# File 'lib/canon/rspec_matchers.rb', line 315

def be_yaml_equivalent_to(expected, match_profile: nil, match: nil,
                          preprocessing: nil, diff_algorithm: nil)
  SerializationMatcher.new(expected, :yaml,
                           match_profile: match_profile,
                           match: match,
                           preprocessing: preprocessing,
                           diff_algorithm: diff_algorithm)
end