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



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

def configure
  yield Canon::Config.configure
end

.htmlObject



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

def html
  Canon::Config.instance.html
end

.jsonObject



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

def json
  Canon::Config.instance.json
end

.reset_configObject



24
25
26
# File 'lib/canon/rspec_matchers.rb', line 24

def reset_config
  Canon::Config.reset!
end

.xmlObject

Delegate configuration getters to Canon::Config



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

def xml
  Canon::Config.instance.xml
end

.yamlObject



41
42
43
# File 'lib/canon/rspec_matchers.rb', line 41

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



375
376
377
378
379
380
381
382
# File 'lib/canon/rspec_matchers.rb', line 375

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



438
439
440
441
442
443
444
445
# File 'lib/canon/rspec_matchers.rb', line 438

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



420
421
422
423
424
425
426
427
# File 'lib/canon/rspec_matchers.rb', line 420

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



429
430
431
432
433
434
435
436
# File 'lib/canon/rspec_matchers.rb', line 429

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



411
412
413
414
415
416
417
418
# File 'lib/canon/rspec_matchers.rb', line 411

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



402
403
404
405
406
407
408
409
# File 'lib/canon/rspec_matchers.rb', line 402

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



365
366
367
368
369
370
371
372
373
# File 'lib/canon/rspec_matchers.rb', line 365

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



447
448
449
450
451
452
453
454
# File 'lib/canon/rspec_matchers.rb', line 447

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



384
385
386
387
388
389
390
391
# File 'lib/canon/rspec_matchers.rb', line 384

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



393
394
395
396
397
398
399
400
# File 'lib/canon/rspec_matchers.rb', line 393

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