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



246
247
248
249
250
251
252
253
# File 'lib/canon/rspec_matchers.rb', line 246

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



309
310
311
312
313
314
315
316
# File 'lib/canon/rspec_matchers.rb', line 309

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



291
292
293
294
295
296
297
298
# File 'lib/canon/rspec_matchers.rb', line 291

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



300
301
302
303
304
305
306
307
# File 'lib/canon/rspec_matchers.rb', line 300

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



282
283
284
285
286
287
288
289
# File 'lib/canon/rspec_matchers.rb', line 282

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



273
274
275
276
277
278
279
280
# File 'lib/canon/rspec_matchers.rb', line 273

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



236
237
238
239
240
241
242
243
244
# File 'lib/canon/rspec_matchers.rb', line 236

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



318
319
320
321
322
323
324
325
# File 'lib/canon/rspec_matchers.rb', line 318

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



255
256
257
258
259
260
261
262
# File 'lib/canon/rspec_matchers.rb', line 255

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



264
265
266
267
268
269
270
271
# File 'lib/canon/rspec_matchers.rb', line 264

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