You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require"bundler/inline"gemfiledosource"https://rubygems.org"gem"rspec","3.13.0"gem"super_diff","0.12.1"endrequire"rspec/autorun"require"super_diff/rspec"ifENV["SUPERDIFF"]RSpec.describe"A contain_exactly/match_array expectation"doit"fails with an extra element"doexpect(ENV.keys).tocontain_exactly("EXTRA", *ENV.keys)endit"fails with a missing element"doexpect(ENV.keys).tomatch_array(ENV.to_h.except("HOME").keys)endend
When I run it without superdiff, I get this output:
$ ruby superdiff_contains_exactly.rb
FF
Failures:
1) A contain_exactly/match_array expectation fails with an extra element
Failure/Error: expect(ENV.keys).to contain_exactly("EXTRA", *ENV.keys)
expected collection contained: [redacted so as not to leak the ENV vars on my machine]
actual collection contained: [redacted so as not to leak the ENV vars on my machine]
the missing elements were: ["EXTRA"]
# superdiff_contains_exactly.rb:14:in `block (2 levels) in <main>'
2) A contain_exactly/match_array expectation fails with a missing element
Failure/Error: expect(ENV.keys).to match_array(ENV.to_h.except("HOME").keys)
expected collection contained: [redacted so as not to leak the ENV vars on my machine]
actual collection contained: [redacted so as not to leak the ENV vars on my machine]
the extra elements were: ["HOME"]
# superdiff_contains_exactly.rb:18:in `block (2 levels) in <main>'
Finished in 0.01349 seconds (files took 0.05948 seconds to load)
2 examples, 2 failures
Failed examples:
rspec superdiff_contains_exactly.rb:13 # A contain_exactly/match_array expectation fails with an extra element
rspec superdiff_contains_exactly.rb:17 # A contain_exactly/match_array expectation fails with a missing element
When I run it with superdiff, I get this output:
~/Development/sq-elasticgraph-ruby/tmp/ [myron/make-superdiff-opt-in] SUPERDIFF=1 ruby superdiff_contains_exactly.rb
FF
Failures:
1) A contain_exactly/match_array expectation fails with an extra element
Failure/Error: expect(ENV.keys).to contain_exactly("EXTRA", *ENV.keys)
Expected [redacted so as not to leak the ENV vars on my machine]
to contain exactly [redacted so as not to leak the ENV vars on my machine]
# /Users/myron/.rvm/gems/ruby-3.2.3/gems/super_diff-0.12.1/lib/super_diff/rspec/monkey_patches.rb:43:in `handle_failure'
# superdiff_contains_exactly.rb:14:in `block (2 levels) in <main>'
2) A contain_exactly/match_array expectation fails with a missing element
Failure/Error: expect(ENV.keys).to match_array(ENV.to_h.except("HOME").keys)
Expected [redacted so as not to leak the ENV vars on my machine]
to match array with [redacted so as not to leak the ENV vars on my machine]
# /Users/myron/.rvm/gems/ruby-3.2.3/gems/super_diff-0.12.1/lib/super_diff/rspec/monkey_patches.rb:43:in `handle_failure'
# superdiff_contains_exactly.rb:18:in `block (2 levels) in <main>'
Finished in 0.03072 seconds (files took 0.0479 seconds to load)
2 examples, 2 failures
Failed examples:
rspec superdiff_contains_exactly.rb:13 # A contain_exactly/match_array expectation fails with an extra element
rspec superdiff_contains_exactly.rb:17 # A contain_exactly/match_array expectation fails with a missing element
(...but with the redacted bits not redacted...).
The stock RSpec output makes it very easy to see what the extra elements or missing elements are. With superdiff it's super hard to tell.
Could superdiff retain the the missing elements were: and the extra elements were: parts of the standard RSpec output?
The text was updated successfully, but these errors were encountered:
Given
superdiff_contains.rb
:When I run it without superdiff, I get this output:
When I run it with superdiff, I get this output:
(...but with the redacted bits not redacted...).
The stock RSpec output makes it very easy to see what the extra elements or missing elements are. With superdiff it's super hard to tell.
Could superdiff retain the
the missing elements were:
andthe extra elements were:
parts of the standard RSpec output?The text was updated successfully, but these errors were encountered: