Module: Canon::RSpecMatchers
- Defined in:
- lib/canon/rspec_matchers.rb
Defined Under Namespace
Classes: SerializationMatcher
Class Method Summary collapse
- .configure {|Canon::Config.configure| ... } ⇒ Object
- .html ⇒ Object
- .json ⇒ Object
- .reset_config ⇒ Object
-
.xml ⇒ Object
Delegate configuration getters to Canon::Config.
- .yaml ⇒ Object
Instance Method Summary collapse
- #be_analogous_with(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_html4_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_html5_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_html_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_json_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
-
#be_serialization_equivalent_to(expected, format: :xml, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
Matcher methods.
- #be_string_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_xml_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
- #be_yaml_equivalent_to(expected, match_profile: nil, match: nil, preprocessing: nil, diff_algorithm: nil) ⇒ Object
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 |
.html ⇒ Object
30 31 32 |
# File 'lib/canon/rspec_matchers.rb', line 30 def html Canon::Config.instance.html end |
.json ⇒ Object
34 35 36 |
# File 'lib/canon/rspec_matchers.rb', line 34 def json Canon::Config.instance.json end |
.reset_config ⇒ Object
21 22 23 |
# File 'lib/canon/rspec_matchers.rb', line 21 def reset_config Canon::Config.reset! 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 |