super_diff 0.9.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +65 -26
- data/lib/super_diff/active_record/differs/active_record_relation.rb +1 -2
- data/lib/super_diff/active_record/differs.rb +1 -1
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_model.rb +22 -18
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb +14 -7
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb +2 -2
- data/lib/super_diff/active_record/object_inspection.rb +1 -1
- data/lib/super_diff/active_record/operation_tree_builders/active_record_model.rb +1 -2
- data/lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb +1 -2
- data/lib/super_diff/active_record/operation_tree_builders.rb +2 -2
- data/lib/super_diff/active_record/operation_tree_flatteners.rb +1 -1
- data/lib/super_diff/active_record/operation_trees.rb +1 -1
- data/lib/super_diff/active_record.rb +7 -15
- data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +5 -6
- data/lib/super_diff/active_support/differs.rb +1 -1
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb +20 -11
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/ordered_options.rb +46 -0
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb +5 -1
- data/lib/super_diff/active_support/object_inspection.rb +1 -1
- data/lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb +5 -6
- data/lib/super_diff/active_support/operation_tree_builders.rb +1 -1
- data/lib/super_diff/active_support/operation_tree_flatteners.rb +1 -1
- data/lib/super_diff/active_support/operation_trees.rb +1 -1
- data/lib/super_diff/active_support.rb +6 -10
- data/lib/super_diff/colorized_document_extensions.rb +2 -4
- data/lib/super_diff/configuration.rb +14 -8
- data/lib/super_diff/csi/color.rb +4 -4
- data/lib/super_diff/csi/colorized_document.rb +12 -16
- data/lib/super_diff/csi/document.rb +8 -19
- data/lib/super_diff/csi/eight_bit_color.rb +19 -19
- data/lib/super_diff/csi/four_bit_color.rb +82 -31
- data/lib/super_diff/csi/twenty_four_bit_color.rb +12 -11
- data/lib/super_diff/csi/uncolorized_document.rb +2 -6
- data/lib/super_diff/csi.rb +10 -14
- data/lib/super_diff/diff_formatters/collection.rb +35 -41
- data/lib/super_diff/differs/date_like.rb +15 -0
- data/lib/super_diff/differs/default_object.rb +1 -1
- data/lib/super_diff/differs/defaults.rb +2 -1
- data/lib/super_diff/differs/main.rb +2 -13
- data/lib/super_diff/differs.rb +1 -0
- data/lib/super_diff/equality_matchers/array.rb +10 -12
- data/lib/super_diff/equality_matchers/base.rb +1 -1
- data/lib/super_diff/equality_matchers/default.rb +2 -4
- data/lib/super_diff/equality_matchers/defaults.rb +1 -1
- data/lib/super_diff/equality_matchers/hash.rb +10 -12
- data/lib/super_diff/equality_matchers/multiline_string.rb +11 -13
- data/lib/super_diff/equality_matchers/primitive.rb +10 -12
- data/lib/super_diff/equality_matchers/singleline_string.rb +10 -12
- data/lib/super_diff/equality_matchers.rb +1 -1
- data/lib/super_diff/errors.rb +2 -6
- data/lib/super_diff/gem_version.rb +3 -3
- data/lib/super_diff/helpers.rb +10 -10
- data/lib/super_diff/implementation_checks.rb +2 -2
- data/lib/super_diff/line.rb +3 -3
- data/lib/super_diff/object_inspection/inspection_tree.rb +64 -73
- data/lib/super_diff/object_inspection/inspection_tree_builders/array.rb +29 -14
- data/lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb +17 -13
- data/lib/super_diff/object_inspection/inspection_tree_builders/date_like.rb +51 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb +43 -27
- data/lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb +2 -1
- data/lib/super_diff/object_inspection/inspection_tree_builders/hash.rb +35 -18
- data/lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb +3 -5
- data/lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb +30 -36
- data/lib/super_diff/object_inspection/inspection_tree_builders.rb +13 -9
- data/lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb +11 -22
- data/lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb +1 -5
- data/lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb +1 -5
- data/lib/super_diff/object_inspection/nodes/as_single_line.rb +3 -7
- data/lib/super_diff/object_inspection/nodes/base.rb +9 -14
- data/lib/super_diff/object_inspection/nodes/inspection.rb +26 -34
- data/lib/super_diff/object_inspection/nodes/nesting.rb +1 -1
- data/lib/super_diff/object_inspection/nodes/only_when.rb +2 -6
- data/lib/super_diff/object_inspection/nodes/text.rb +1 -5
- data/lib/super_diff/object_inspection/nodes/when_empty.rb +2 -6
- data/lib/super_diff/object_inspection/nodes/when_non_empty.rb +2 -6
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb +1 -1
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb +1 -5
- data/lib/super_diff/object_inspection/nodes.rb +7 -7
- data/lib/super_diff/object_inspection.rb +3 -3
- data/lib/super_diff/operation_tree_builders/array.rb +12 -11
- data/lib/super_diff/operation_tree_builders/base.rb +17 -15
- data/lib/super_diff/operation_tree_builders/custom_object.rb +8 -6
- data/lib/super_diff/operation_tree_builders/date_like.rb +15 -0
- data/lib/super_diff/operation_tree_builders/default_object.rb +29 -21
- data/lib/super_diff/operation_tree_builders/defaults.rb +1 -1
- data/lib/super_diff/operation_tree_builders/hash.rb +23 -24
- data/lib/super_diff/operation_tree_builders/main.rb +4 -11
- data/lib/super_diff/operation_tree_builders/multiline_string.rb +3 -3
- data/lib/super_diff/operation_tree_builders/time_like.rb +1 -11
- data/lib/super_diff/operation_tree_builders.rb +2 -1
- data/lib/super_diff/operation_tree_flatteners/base.rb +1 -5
- data/lib/super_diff/operation_tree_flatteners/collection.rb +13 -16
- data/lib/super_diff/operation_tree_flatteners/default_object.rb +1 -2
- data/lib/super_diff/operation_tree_flatteners/hash.rb +2 -10
- data/lib/super_diff/operation_tree_flatteners/multiline_string.rb +2 -1
- data/lib/super_diff/operation_tree_flatteners.rb +3 -3
- data/lib/super_diff/operation_trees/base.rb +3 -5
- data/lib/super_diff/operation_trees/default_object.rb +1 -3
- data/lib/super_diff/operations/binary_operation.rb +2 -2
- data/lib/super_diff/operations/unary_operation.rb +1 -1
- data/lib/super_diff/rails.rb +2 -1
- data/lib/super_diff/recursion_guard.rb +5 -4
- data/lib/super_diff/rspec/augmented_matcher.rb +4 -5
- data/lib/super_diff/rspec/differ.rb +6 -13
- data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +3 -2
- data/lib/super_diff/rspec/differs/collection_including.rb +1 -1
- data/lib/super_diff/rspec/differs/hash_including.rb +1 -1
- data/lib/super_diff/rspec/differs.rb +3 -3
- data/lib/super_diff/rspec/matcher_text_builders/base.rb +13 -15
- data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +5 -7
- data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +3 -5
- data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +2 -10
- data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +2 -6
- data/lib/super_diff/rspec/matcher_text_builders.rb +5 -8
- data/lib/super_diff/rspec/matcher_text_template.rb +13 -16
- data/lib/super_diff/rspec/monkey_patches.rb +180 -123
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_containing_exactly.rb +14 -7
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +21 -13
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +35 -36
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/generic_describable_matcher.rb +19 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +21 -15
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +11 -10
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +11 -10
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/object_having_attributes.rb +14 -7
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb +10 -11
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +13 -9
- data/lib/super_diff/rspec/object_inspection.rb +1 -1
- data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +11 -10
- data/lib/super_diff/rspec/operation_tree_builders/collection_including.rb +7 -6
- data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +11 -10
- data/lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb +22 -17
- data/lib/super_diff/rspec/operation_tree_builders.rb +4 -4
- data/lib/super_diff/rspec.rb +17 -18
- data/lib/super_diff/tiered_lines_elider.rb +87 -115
- data/lib/super_diff/tiered_lines_formatter.rb +5 -9
- data/lib/super_diff/version.rb +1 -1
- data/lib/super_diff.rb +13 -9
- data/spec/examples.txt +541 -483
- data/spec/integration/rails/active_record_spec.rb +3 -1
- data/spec/integration/rails/engines_spec.rb +25 -0
- data/spec/integration/rails/hash_with_indifferent_access_spec.rb +3 -1
- data/spec/integration/rspec/be_falsey_matcher_spec.rb +40 -35
- data/spec/integration/rspec/be_matcher_spec.rb +360 -320
- data/spec/integration/rspec/be_nil_matcher_spec.rb +38 -34
- data/spec/integration/rspec/be_predicate_matcher_spec.rb +376 -359
- data/spec/integration/rspec/be_truthy_matcher_spec.rb +38 -33
- data/spec/integration/rspec/contain_exactly_matcher_spec.rb +257 -254
- data/spec/integration/rspec/eq_matcher_spec.rb +695 -585
- data/spec/integration/rspec/generic_describable_matchers_spec.rb +177 -0
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +312 -304
- data/spec/integration/rspec/have_predicate_matcher_spec.rb +291 -297
- data/spec/integration/rspec/include_matcher_spec.rb +327 -225
- data/spec/integration/rspec/magic_metadata_spec.rb +51 -0
- data/spec/integration/rspec/match_array_matcher_spec.rb +294 -291
- data/spec/integration/rspec/match_matcher_spec.rb +916 -903
- data/spec/integration/rspec/raise_error_matcher_spec.rb +1208 -449
- data/spec/integration/rspec/respond_to_matcher_spec.rb +702 -697
- data/spec/integration/rspec/third_party_matcher_spec.rb +142 -138
- data/spec/integration/rspec/unhandled_errors_spec.rb +88 -84
- data/spec/internal/log/test.log +0 -0
- data/spec/spec_helper.rb +20 -20
- data/spec/support/command_runner.rb +34 -57
- data/spec/support/integration/helpers.rb +44 -32
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +28 -23
- data/spec/support/integration/matchers.rb +34 -0
- data/spec/support/integration/test_programs/base.rb +17 -22
- data/spec/support/integration/test_programs/plain.rb +6 -0
- data/spec/support/integration/test_programs/rspec_active_record.rb +4 -1
- data/spec/support/integration/test_programs/rspec_active_support.rb +4 -1
- data/spec/support/integration/test_programs/rspec_rails.rb +4 -1
- data/spec/support/integration/test_programs/rspec_rails_engine.rb +20 -0
- data/spec/support/models/active_record/person.rb +6 -4
- data/spec/support/models/active_record/shipping_address.rb +9 -10
- data/spec/support/models/customer.rb +2 -4
- data/spec/support/models/player.rb +3 -6
- data/spec/support/models/shipping_address.rb +4 -13
- data/spec/support/shared_examples/active_record.rb +258 -240
- data/spec/support/shared_examples/active_support.rb +174 -51
- data/spec/support/shared_examples/elided_diffs.rb +447 -423
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +500 -464
- data/spec/support/shared_examples/key.rb +123 -0
- data/spec/support/unit/helpers.rb +1 -3
- data/spec/support/unit/matchers/match_output.rb +12 -13
- data/spec/unit/active_record/object_inspection_spec.rb +222 -206
- data/spec/unit/active_support/object_inspection_spec.rb +170 -0
- data/spec/unit/equality_matchers/main_spec.rb +1049 -984
- data/spec/unit/helpers_spec.rb +14 -21
- data/spec/unit/operation_tree_flatteners/array_spec.rb +557 -524
- data/spec/unit/operation_tree_flatteners/custom_object_spec.rb +619 -601
- data/spec/unit/operation_tree_flatteners/default_object_spec.rb +619 -621
- data/spec/unit/operation_tree_flatteners/hash_spec.rb +595 -556
- data/spec/unit/operation_tree_flatteners/multiline_string_spec.rb +102 -92
- data/spec/unit/rspec/matchers/be_compared_to_spec.rb +3 -3
- data/spec/unit/rspec/matchers/be_predicate_spec.rb +3 -3
- data/spec/unit/rspec/matchers/contain_exactly_spec.rb +1 -1
- data/spec/unit/rspec/matchers/have_attributes_spec.rb +1 -1
- data/spec/unit/rspec/matchers/have_predicate_spec.rb +2 -2
- data/spec/unit/rspec/matchers/include_spec.rb +2 -2
- data/spec/unit/rspec/matchers/match_array_spec.rb +2 -2
- data/spec/unit/rspec/matchers/raise_error_spec.rb +43 -11
- data/spec/unit/rspec/matchers/respond_to_spec.rb +23 -16
- data/spec/unit/rspec/object_inspection/rspec_matcher_spec.rb +91 -0
- data/spec/unit/rspec/object_inspection_spec.rb +351 -326
- data/spec/unit/super_diff_spec.rb +1594 -1437
- data/spec/unit/tiered_lines_elider_spec.rb +3508 -3536
- data/spec/unit/tiered_lines_formatter_spec.rb +54 -116
- data/super_diff.gemspec +13 -12
- metadata +88 -75
- data/lib/super_diff/errors/no_diff_formatter_available_error.rb +0 -21
- data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +0 -22
- data/spec/tmp/warnings_logger/all_warnings.txt +0 -2
@@ -4,51 +4,55 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
4
4
|
context "when comparing two different integers" do
|
5
5
|
it "produces the correct failure message when used in the positive" do
|
6
6
|
as_both_colored_and_uncolored do |color_enabled|
|
7
|
-
snippet =
|
7
|
+
snippet = "expect(1).to eq(42)"
|
8
8
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
9
9
|
|
10
|
-
expected_output =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
expected_output =
|
11
|
+
build_expected_output(
|
12
|
+
color_enabled: color_enabled,
|
13
|
+
snippet: snippet,
|
14
|
+
expectation:
|
15
|
+
proc do
|
16
|
+
line do
|
17
|
+
plain "Expected "
|
18
|
+
actual "1"
|
19
|
+
plain " to eq "
|
20
|
+
expected "42"
|
21
|
+
plain "."
|
22
|
+
end
|
23
|
+
end
|
24
|
+
)
|
23
25
|
|
24
|
-
expect(program).
|
25
|
-
|
26
|
-
|
26
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
27
|
+
color_enabled
|
28
|
+
)
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
30
32
|
it "produces the correct failure message when used in the negative" do
|
31
33
|
as_both_colored_and_uncolored do |color_enabled|
|
32
|
-
snippet =
|
34
|
+
snippet = "expect(42).not_to eq(42)"
|
33
35
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
34
36
|
|
35
|
-
expected_output =
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
37
|
+
expected_output =
|
38
|
+
build_expected_output(
|
39
|
+
color_enabled: color_enabled,
|
40
|
+
snippet: snippet,
|
41
|
+
expectation:
|
42
|
+
proc do
|
43
|
+
line do
|
44
|
+
plain "Expected "
|
45
|
+
actual "42"
|
46
|
+
plain " not to eq "
|
47
|
+
expected "42"
|
48
|
+
plain "."
|
49
|
+
end
|
50
|
+
end
|
51
|
+
)
|
48
52
|
|
49
|
-
expect(program).
|
50
|
-
|
51
|
-
|
53
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
54
|
+
color_enabled
|
55
|
+
)
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
@@ -56,57 +60,55 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
56
60
|
context "when comparing two different symbols" do
|
57
61
|
it "produces the correct failure message when used in the positive" do
|
58
62
|
as_both_colored_and_uncolored do |color_enabled|
|
59
|
-
snippet =
|
60
|
-
program = make_plain_test_program(
|
61
|
-
snippet,
|
62
|
-
color_enabled: color_enabled,
|
63
|
-
)
|
63
|
+
snippet = "expect(:bar).to eq(:foo)"
|
64
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
64
65
|
|
65
|
-
expected_output =
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
66
|
+
expected_output =
|
67
|
+
build_expected_output(
|
68
|
+
color_enabled: color_enabled,
|
69
|
+
snippet: snippet,
|
70
|
+
expectation:
|
71
|
+
proc do
|
72
|
+
line do
|
73
|
+
plain "Expected "
|
74
|
+
actual ":bar"
|
75
|
+
plain " to eq "
|
76
|
+
expected ":foo"
|
77
|
+
plain "."
|
78
|
+
end
|
79
|
+
end
|
80
|
+
)
|
78
81
|
|
79
|
-
expect(program).
|
80
|
-
|
81
|
-
|
82
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
83
|
+
color_enabled
|
84
|
+
)
|
82
85
|
end
|
83
86
|
end
|
84
87
|
|
85
88
|
it "produces the correct failure message when used in the negative" do
|
86
89
|
as_both_colored_and_uncolored do |color_enabled|
|
87
|
-
snippet =
|
88
|
-
program = make_plain_test_program(
|
89
|
-
snippet,
|
90
|
-
color_enabled: color_enabled,
|
91
|
-
)
|
90
|
+
snippet = "expect(:foo).not_to eq(:foo)"
|
91
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
92
92
|
|
93
|
-
expected_output =
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
93
|
+
expected_output =
|
94
|
+
build_expected_output(
|
95
|
+
color_enabled: color_enabled,
|
96
|
+
snippet: snippet,
|
97
|
+
expectation:
|
98
|
+
proc do
|
99
|
+
line do
|
100
|
+
plain "Expected "
|
101
|
+
actual ":foo"
|
102
|
+
plain " not to eq "
|
103
|
+
expected ":foo"
|
104
|
+
plain "."
|
105
|
+
end
|
106
|
+
end
|
107
|
+
)
|
106
108
|
|
107
|
-
expect(program).
|
108
|
-
|
109
|
-
|
109
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
110
|
+
color_enabled
|
111
|
+
)
|
110
112
|
end
|
111
113
|
end
|
112
114
|
end
|
@@ -115,56 +117,54 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
115
117
|
it "produces the correct failure message when used in the positive" do
|
116
118
|
as_both_colored_and_uncolored do |color_enabled|
|
117
119
|
snippet = %|expect("Jennifer").to eq("Marty")|
|
118
|
-
program = make_plain_test_program(
|
119
|
-
snippet,
|
120
|
-
color_enabled: color_enabled,
|
121
|
-
)
|
120
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
122
121
|
|
123
|
-
expected_output =
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
122
|
+
expected_output =
|
123
|
+
build_expected_output(
|
124
|
+
color_enabled: color_enabled,
|
125
|
+
snippet: %|expect("Jennifer").to eq("Marty")|,
|
126
|
+
expectation:
|
127
|
+
proc do
|
128
|
+
line do
|
129
|
+
plain "Expected "
|
130
|
+
actual %|"Jennifer"|
|
131
|
+
plain " to eq "
|
132
|
+
expected %|"Marty"|
|
133
|
+
plain "."
|
134
|
+
end
|
135
|
+
end
|
136
|
+
)
|
136
137
|
|
137
|
-
expect(program).
|
138
|
-
|
139
|
-
|
138
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
139
|
+
color_enabled
|
140
|
+
)
|
140
141
|
end
|
141
142
|
end
|
142
143
|
|
143
144
|
it "produces the correct failure message when used in the negative" do
|
144
145
|
as_both_colored_and_uncolored do |color_enabled|
|
145
146
|
snippet = %|expect("Jennifer").not_to eq("Jennifer")|
|
146
|
-
program = make_plain_test_program(
|
147
|
-
snippet,
|
148
|
-
color_enabled: color_enabled,
|
149
|
-
)
|
147
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
150
148
|
|
151
|
-
expected_output =
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
149
|
+
expected_output =
|
150
|
+
build_expected_output(
|
151
|
+
color_enabled: color_enabled,
|
152
|
+
snippet: %|expect("Jennifer").not_to eq("Jennifer")|,
|
153
|
+
expectation:
|
154
|
+
proc do
|
155
|
+
line do
|
156
|
+
plain "Expected "
|
157
|
+
actual %|"Jennifer"|
|
158
|
+
plain " not to eq "
|
159
|
+
expected %|"Jennifer"|
|
160
|
+
plain "."
|
161
|
+
end
|
162
|
+
end
|
163
|
+
)
|
164
164
|
|
165
|
-
expect(program).
|
166
|
-
|
167
|
-
|
165
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
166
|
+
color_enabled
|
167
|
+
)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
end
|
@@ -173,48 +173,48 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
173
173
|
it "produces the correct failure message when used in the positive" do
|
174
174
|
as_both_colored_and_uncolored do |color_enabled|
|
175
175
|
snippet = <<~RUBY
|
176
|
-
|
177
|
-
|
178
|
-
expect(
|
176
|
+
actual = Time.utc(2011, 12, 13, 14, 15, 16)
|
177
|
+
expected = Time.utc(2011, 12, 13, 14, 15, 16, 500_000)
|
178
|
+
expect(actual).to eq(expected)
|
179
179
|
RUBY
|
180
|
-
program = make_plain_test_program(
|
181
|
-
snippet,
|
182
|
-
color_enabled: color_enabled,
|
183
|
-
)
|
180
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
184
181
|
|
185
|
-
expected_output =
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
182
|
+
expected_output =
|
183
|
+
build_expected_output(
|
184
|
+
color_enabled: color_enabled,
|
185
|
+
snippet: "expect(actual).to eq(expected)",
|
186
|
+
expectation:
|
187
|
+
proc do
|
188
|
+
line do
|
189
|
+
plain "Expected "
|
190
|
+
actual "#<Time 2011-12-13 14:15:16 +00:00 (UTC)>"
|
191
|
+
end
|
192
|
+
|
193
|
+
line do
|
194
|
+
plain " to eq "
|
195
|
+
expected "#<Time 2011-12-13 14:15:16+(1/2) +00:00 (UTC)>"
|
196
|
+
end
|
197
|
+
end,
|
198
|
+
diff:
|
199
|
+
proc do
|
200
|
+
plain_line " #<Time {"
|
201
|
+
plain_line " year: 2011,"
|
202
|
+
plain_line " month: 12,"
|
203
|
+
plain_line " day: 13,"
|
204
|
+
plain_line " hour: 14,"
|
205
|
+
plain_line " min: 15,"
|
206
|
+
plain_line " sec: 16,"
|
207
|
+
expected_line "- subsec: (1/2),"
|
208
|
+
actual_line "+ subsec: 0,"
|
209
|
+
plain_line " zone: \"UTC\","
|
210
|
+
plain_line " utc_offset: 0"
|
211
|
+
plain_line " }>"
|
212
|
+
end
|
213
|
+
)
|
214
214
|
|
215
|
-
expect(program).
|
216
|
-
|
217
|
-
|
215
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
216
|
+
color_enabled
|
217
|
+
)
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
@@ -224,31 +224,102 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
224
224
|
time = Time.utc(2011, 12, 13, 14, 15, 16)
|
225
225
|
expect(time).not_to eq(time)
|
226
226
|
RUBY
|
227
|
-
program = make_plain_test_program(
|
228
|
-
|
229
|
-
|
227
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
228
|
+
|
229
|
+
expected_output =
|
230
|
+
build_expected_output(
|
231
|
+
color_enabled: color_enabled,
|
232
|
+
snippet: "expect(time).not_to eq(time)",
|
233
|
+
newline_before_expectation: true,
|
234
|
+
expectation:
|
235
|
+
proc do
|
236
|
+
line do
|
237
|
+
plain " Expected "
|
238
|
+
actual "#<Time 2011-12-13 14:15:16 +00:00 (UTC)>"
|
239
|
+
end
|
240
|
+
|
241
|
+
line do
|
242
|
+
plain "not to eq "
|
243
|
+
expected "#<Time 2011-12-13 14:15:16 +00:00 (UTC)>"
|
244
|
+
end
|
245
|
+
end
|
246
|
+
)
|
247
|
+
|
248
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
249
|
+
color_enabled
|
230
250
|
)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
context "when comparing two different Date instances" do
|
256
|
+
it "produces the correct failure message when used in the positive" do
|
257
|
+
as_both_colored_and_uncolored do |color_enabled|
|
258
|
+
snippet = <<~RUBY
|
259
|
+
actual = Date.new(2023, 10, 14)
|
260
|
+
expected = Date.new(2023, 10, 31)
|
261
|
+
expect(actual).to eq(expected)
|
262
|
+
RUBY
|
263
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
231
264
|
|
232
|
-
expected_output =
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
265
|
+
expected_output =
|
266
|
+
build_expected_output(
|
267
|
+
color_enabled: color_enabled,
|
268
|
+
snippet: "expect(actual).to eq(expected)",
|
269
|
+
expectation:
|
270
|
+
proc do
|
271
|
+
line do
|
272
|
+
plain "Expected "
|
273
|
+
actual "#<Date 2023-10-14>"
|
274
|
+
plain " to eq "
|
275
|
+
expected "#<Date 2023-10-31>"
|
276
|
+
plain "."
|
277
|
+
end
|
278
|
+
end,
|
279
|
+
diff:
|
280
|
+
proc do
|
281
|
+
plain_line " #<Date {"
|
282
|
+
plain_line " year: 2023,"
|
283
|
+
plain_line " month: 10,"
|
284
|
+
expected_line "- day: 31"
|
285
|
+
actual_line "+ day: 14"
|
286
|
+
plain_line " }>"
|
287
|
+
end
|
288
|
+
)
|
289
|
+
|
290
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
291
|
+
color_enabled
|
247
292
|
)
|
293
|
+
end
|
294
|
+
end
|
248
295
|
|
249
|
-
|
250
|
-
|
251
|
-
|
296
|
+
it "produces the correct failure message when used in the negative" do
|
297
|
+
as_both_colored_and_uncolored do |color_enabled|
|
298
|
+
snippet = <<~RUBY
|
299
|
+
date = Date.new(2023, 10, 14)
|
300
|
+
expect(date).not_to eq(date)
|
301
|
+
RUBY
|
302
|
+
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
303
|
+
|
304
|
+
expected_output =
|
305
|
+
build_expected_output(
|
306
|
+
color_enabled: color_enabled,
|
307
|
+
snippet: "expect(date).not_to eq(date)",
|
308
|
+
expectation:
|
309
|
+
proc do
|
310
|
+
line do
|
311
|
+
plain "Expected "
|
312
|
+
actual "#<Date 2023-10-14>"
|
313
|
+
plain " not to eq "
|
314
|
+
expected "#<Date 2023-10-14>"
|
315
|
+
plain "."
|
316
|
+
end
|
317
|
+
end
|
318
|
+
)
|
319
|
+
|
320
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
321
|
+
color_enabled
|
322
|
+
)
|
252
323
|
end
|
253
324
|
end
|
254
325
|
end
|
@@ -257,34 +328,37 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
257
328
|
it "produces the correct failure message" do
|
258
329
|
as_both_colored_and_uncolored do |color_enabled|
|
259
330
|
snippet = <<~TEST.strip
|
331
|
+
actual = "This is a line\\nAnd that's another line\\n"
|
260
332
|
expected = "Something entirely different"
|
261
|
-
actual = "This is a line\\nAnd that's another line\\n"
|
262
333
|
expect(actual).to eq(expected)
|
263
334
|
TEST
|
264
335
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
265
336
|
|
266
|
-
expected_output =
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
337
|
+
expected_output =
|
338
|
+
build_expected_output(
|
339
|
+
color_enabled: color_enabled,
|
340
|
+
snippet: "expect(actual).to eq(expected)",
|
341
|
+
expectation:
|
342
|
+
proc do
|
343
|
+
line do
|
344
|
+
plain "Expected "
|
345
|
+
actual %|"This is a line\\nAnd that's another line\\n"|
|
346
|
+
plain " to eq "
|
347
|
+
expected %|"Something entirely different"|
|
348
|
+
plain "."
|
349
|
+
end
|
350
|
+
end,
|
351
|
+
diff:
|
352
|
+
proc do
|
353
|
+
expected_line "- Something entirely different"
|
354
|
+
actual_line %|+ This is a line\\n|
|
355
|
+
actual_line %|+ And that's another line\\n|
|
356
|
+
end
|
357
|
+
)
|
284
358
|
|
285
|
-
expect(program).
|
286
|
-
|
287
|
-
|
359
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
360
|
+
color_enabled
|
361
|
+
)
|
288
362
|
end
|
289
363
|
end
|
290
364
|
end
|
@@ -293,34 +367,37 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
293
367
|
it "produces the correct failure message" do
|
294
368
|
as_both_colored_and_uncolored do |color_enabled|
|
295
369
|
snippet = <<~TEST.strip
|
370
|
+
actual = "Something entirely different"
|
296
371
|
expected = "This is a line\\nAnd that's another line\\n"
|
297
|
-
actual = "Something entirely different"
|
298
372
|
expect(actual).to eq(expected)
|
299
373
|
TEST
|
300
374
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
301
375
|
|
302
|
-
expected_output =
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
376
|
+
expected_output =
|
377
|
+
build_expected_output(
|
378
|
+
color_enabled: color_enabled,
|
379
|
+
snippet: "expect(actual).to eq(expected)",
|
380
|
+
expectation:
|
381
|
+
proc do
|
382
|
+
line do
|
383
|
+
plain "Expected "
|
384
|
+
actual %|"Something entirely different"|
|
385
|
+
plain " to eq "
|
386
|
+
expected %|"This is a line\\nAnd that's another line\\n"|
|
387
|
+
plain "."
|
388
|
+
end
|
389
|
+
end,
|
390
|
+
diff:
|
391
|
+
proc do
|
392
|
+
expected_line %|- This is a line\\n|
|
393
|
+
expected_line %|- And that's another line\\n|
|
394
|
+
actual_line "+ Something entirely different"
|
395
|
+
end
|
396
|
+
)
|
320
397
|
|
321
|
-
expect(program).
|
322
|
-
|
323
|
-
|
398
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
399
|
+
color_enabled
|
400
|
+
)
|
324
401
|
end
|
325
402
|
end
|
326
403
|
end
|
@@ -329,37 +406,40 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
329
406
|
it "produces the correct failure message when used in the positive" do
|
330
407
|
as_both_colored_and_uncolored do |color_enabled|
|
331
408
|
snippet = <<~TEST.strip
|
409
|
+
actual = "This is a line\\nSomething completely different\\nAnd there's a line too\\n"
|
332
410
|
expected = "This is a line\\nAnd that's a line\\nAnd there's a line too\\n"
|
333
|
-
actual = "This is a line\\nSomething completely different\\nAnd there's a line too\\n"
|
334
411
|
expect(actual).to eq(expected)
|
335
412
|
TEST
|
336
413
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
337
414
|
|
338
|
-
expected_output =
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
415
|
+
expected_output =
|
416
|
+
build_expected_output(
|
417
|
+
color_enabled: color_enabled,
|
418
|
+
snippet: "expect(actual).to eq(expected)",
|
419
|
+
expectation:
|
420
|
+
proc do
|
421
|
+
line do
|
422
|
+
plain "Expected "
|
423
|
+
actual %|"This is a line\\nSomething completely different\\nAnd there's a line too\\n"|
|
424
|
+
end
|
425
|
+
|
426
|
+
line do
|
427
|
+
plain " to eq "
|
428
|
+
expected %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
429
|
+
end
|
430
|
+
end,
|
431
|
+
diff:
|
432
|
+
proc do
|
433
|
+
plain_line %| This is a line\\n|
|
434
|
+
expected_line %|- And that's a line\\n|
|
435
|
+
actual_line %|+ Something completely different\\n|
|
436
|
+
plain_line %| And there's a line too\\n|
|
437
|
+
end
|
438
|
+
)
|
359
439
|
|
360
|
-
expect(program).
|
361
|
-
|
362
|
-
|
440
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
441
|
+
color_enabled
|
442
|
+
)
|
363
443
|
end
|
364
444
|
end
|
365
445
|
|
@@ -371,26 +451,28 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
371
451
|
TEST
|
372
452
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
373
453
|
|
374
|
-
expected_output =
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
454
|
+
expected_output =
|
455
|
+
build_expected_output(
|
456
|
+
color_enabled: color_enabled,
|
457
|
+
snippet: "expect(string).not_to eq(string)",
|
458
|
+
newline_before_expectation: true,
|
459
|
+
expectation:
|
460
|
+
proc do
|
461
|
+
line do
|
462
|
+
plain " Expected "
|
463
|
+
actual %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
464
|
+
end
|
465
|
+
|
466
|
+
line do
|
467
|
+
plain "not to eq "
|
468
|
+
expected %|"This is a line\\nAnd that's a line\\nAnd there's a line too\\n"|
|
469
|
+
end
|
470
|
+
end
|
471
|
+
)
|
390
472
|
|
391
|
-
expect(program).
|
392
|
-
|
393
|
-
|
473
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
474
|
+
color_enabled
|
475
|
+
)
|
394
476
|
end
|
395
477
|
end
|
396
478
|
end
|
@@ -399,20 +481,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
399
481
|
it "produces the correct failure message when used in the positive" do
|
400
482
|
as_both_colored_and_uncolored do |color_enabled|
|
401
483
|
snippet = <<~TEST
|
402
|
-
|
403
|
-
[
|
404
|
-
:h1,
|
405
|
-
[:span, [:text, "Hello world"]],
|
406
|
-
{
|
407
|
-
class: "header",
|
408
|
-
data: {
|
409
|
-
"sticky" => true,
|
410
|
-
person: SuperDiff::Test::Person.new(name: "Marty", age: 60)
|
411
|
-
}
|
412
|
-
}
|
413
|
-
]
|
414
|
-
]
|
415
|
-
actual = [
|
484
|
+
actual = [
|
416
485
|
[
|
417
486
|
:h2,
|
418
487
|
[:span, [:text, "Goodbye world"]],
|
@@ -428,60 +497,76 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
428
497
|
],
|
429
498
|
:br
|
430
499
|
]
|
500
|
+
expected = [
|
501
|
+
[
|
502
|
+
:h1,
|
503
|
+
[:span, [:text, "Hello world"]],
|
504
|
+
{
|
505
|
+
class: "header",
|
506
|
+
data: {
|
507
|
+
"sticky" => true,
|
508
|
+
person: SuperDiff::Test::Person.new(name: "Marty", age: 60)
|
509
|
+
}
|
510
|
+
}
|
511
|
+
]
|
512
|
+
]
|
431
513
|
expect(actual).to eq(expected)
|
432
514
|
TEST
|
433
515
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
434
516
|
|
435
|
-
expected_output =
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
517
|
+
expected_output =
|
518
|
+
build_expected_output(
|
519
|
+
color_enabled: color_enabled,
|
520
|
+
snippet: "expect(actual).to eq(expected)",
|
521
|
+
expectation:
|
522
|
+
proc do
|
523
|
+
line do
|
524
|
+
plain "Expected "
|
525
|
+
actual %|[[:h2, [:span, [:text, "Goodbye world"]], { id: "hero", class: "header", data: { "sticky" => false, :role => "deprecated", :person => #<SuperDiff::Test::Person name: "Doc", age: 60> } }], :br]|
|
526
|
+
end
|
527
|
+
|
528
|
+
line do
|
529
|
+
plain " to eq "
|
530
|
+
expected %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
531
|
+
end
|
532
|
+
end,
|
533
|
+
diff:
|
534
|
+
proc do
|
535
|
+
plain_line " ["
|
536
|
+
plain_line " ["
|
537
|
+
expected_line "- :h1,"
|
538
|
+
actual_line "+ :h2,"
|
539
|
+
plain_line " ["
|
540
|
+
plain_line " :span,"
|
541
|
+
plain_line " ["
|
542
|
+
plain_line " :text,"
|
543
|
+
expected_line %|- "Hello world"|
|
544
|
+
actual_line %|+ "Goodbye world"|
|
545
|
+
plain_line " ]"
|
546
|
+
plain_line " ],"
|
547
|
+
plain_line " {"
|
548
|
+
actual_line %|+ id: "hero",|
|
549
|
+
plain_line %| class: "header",|
|
550
|
+
plain_line " data: {"
|
551
|
+
expected_line %|- "sticky" => true,|
|
552
|
+
actual_line %|+ "sticky" => false,|
|
553
|
+
actual_line %|+ :role => "deprecated",|
|
554
|
+
plain_line " :person => #<SuperDiff::Test::Person {"
|
555
|
+
expected_line %|- name: "Marty",|
|
556
|
+
actual_line %|+ name: "Doc",|
|
557
|
+
plain_line " age: 60"
|
558
|
+
plain_line " }>"
|
559
|
+
plain_line " }"
|
560
|
+
plain_line " }"
|
561
|
+
plain_line " ],"
|
562
|
+
actual_line "+ :br"
|
563
|
+
plain_line " ]"
|
564
|
+
end
|
565
|
+
)
|
481
566
|
|
482
|
-
expect(program).
|
483
|
-
|
484
|
-
|
567
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
568
|
+
color_enabled
|
569
|
+
)
|
485
570
|
end
|
486
571
|
end
|
487
572
|
|
@@ -505,26 +590,28 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
505
590
|
TEST
|
506
591
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
507
592
|
|
508
|
-
expected_output =
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
593
|
+
expected_output =
|
594
|
+
build_expected_output(
|
595
|
+
color_enabled: color_enabled,
|
596
|
+
snippet: "expect(value).not_to eq(value)",
|
597
|
+
newline_before_expectation: true,
|
598
|
+
expectation:
|
599
|
+
proc do
|
600
|
+
line do
|
601
|
+
plain " Expected "
|
602
|
+
actual %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
603
|
+
end
|
604
|
+
|
605
|
+
line do
|
606
|
+
plain "not to eq "
|
607
|
+
expected %|[[:h1, [:span, [:text, "Hello world"]], { class: "header", data: { "sticky" => true, :person => #<SuperDiff::Test::Person name: "Marty", age: 60> } }]]|
|
608
|
+
end
|
609
|
+
end
|
610
|
+
)
|
524
611
|
|
525
|
-
expect(program).
|
526
|
-
|
527
|
-
|
612
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
613
|
+
color_enabled
|
614
|
+
)
|
528
615
|
end
|
529
616
|
end
|
530
617
|
end
|
@@ -533,11 +620,11 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
533
620
|
it "produces the correct failure message when used in the positive" do
|
534
621
|
as_both_colored_and_uncolored do |color_enabled|
|
535
622
|
snippet = <<~TEST.strip
|
536
|
-
|
623
|
+
actual = {
|
537
624
|
customer: {
|
538
|
-
person: SuperDiff::Test::Person.new(name: "Marty McFly", age: 17),
|
625
|
+
person: SuperDiff::Test::Person.new(name: "Marty McFly, Jr.", age: 17),
|
539
626
|
shipping_address: {
|
540
|
-
line_1: "
|
627
|
+
line_1: "456 Ponderosa Ct.",
|
541
628
|
city: "Hill Valley",
|
542
629
|
state: "CA",
|
543
630
|
zip: "90382"
|
@@ -549,14 +636,14 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
549
636
|
cost: 100_000,
|
550
637
|
options: ["red", "blue", "green"]
|
551
638
|
},
|
552
|
-
{ name: "
|
639
|
+
{ name: "Mattel Hoverboard" }
|
553
640
|
]
|
554
641
|
}
|
555
|
-
|
642
|
+
expected = {
|
556
643
|
customer: {
|
557
|
-
person: SuperDiff::Test::Person.new(name: "Marty McFly
|
644
|
+
person: SuperDiff::Test::Person.new(name: "Marty McFly", age: 17),
|
558
645
|
shipping_address: {
|
559
|
-
line_1: "
|
646
|
+
line_1: "123 Main St.",
|
560
647
|
city: "Hill Valley",
|
561
648
|
state: "CA",
|
562
649
|
zip: "90382"
|
@@ -568,65 +655,68 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
568
655
|
cost: 100_000,
|
569
656
|
options: ["red", "blue", "green"]
|
570
657
|
},
|
571
|
-
{ name: "
|
658
|
+
{ name: "Chevy 4x4" }
|
572
659
|
]
|
573
660
|
}
|
574
661
|
expect(actual).to eq(expected)
|
575
662
|
TEST
|
576
663
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
577
664
|
|
578
|
-
expected_output =
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
665
|
+
expected_output =
|
666
|
+
build_expected_output(
|
667
|
+
color_enabled: color_enabled,
|
668
|
+
snippet: "expect(actual).to eq(expected)",
|
669
|
+
expectation:
|
670
|
+
proc do
|
671
|
+
line do
|
672
|
+
plain "Expected "
|
673
|
+
actual %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly, Jr.", age: 17>, shipping_address: { line_1: "456 Ponderosa Ct.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Mattel Hoverboard" }] }|
|
674
|
+
end
|
675
|
+
|
676
|
+
line do
|
677
|
+
plain " to eq "
|
678
|
+
expected %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, shipping_address: { line_1: "123 Main St.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Chevy 4x4" }] }|
|
679
|
+
end
|
680
|
+
end,
|
681
|
+
diff:
|
682
|
+
proc do
|
683
|
+
plain_line " {"
|
684
|
+
plain_line " customer: {"
|
685
|
+
plain_line " person: #<SuperDiff::Test::Person {"
|
686
|
+
expected_line %|- name: "Marty McFly",|
|
687
|
+
actual_line %|+ name: "Marty McFly, Jr.",|
|
688
|
+
plain_line " age: 17"
|
689
|
+
plain_line " }>,"
|
690
|
+
plain_line " shipping_address: {"
|
691
|
+
expected_line %|- line_1: "123 Main St.",|
|
692
|
+
actual_line %|+ line_1: "456 Ponderosa Ct.",|
|
693
|
+
plain_line %| city: "Hill Valley",|
|
694
|
+
plain_line %| state: "CA",|
|
695
|
+
plain_line %| zip: "90382"|
|
696
|
+
plain_line " }"
|
697
|
+
plain_line " },"
|
698
|
+
plain_line " items: ["
|
699
|
+
plain_line " {"
|
700
|
+
plain_line %| name: "Fender Stratocaster",|
|
701
|
+
plain_line " cost: 100000,"
|
702
|
+
plain_line " options: ["
|
703
|
+
plain_line %| "red",|
|
704
|
+
plain_line %| "blue",|
|
705
|
+
plain_line %| "green"|
|
706
|
+
plain_line " ]"
|
707
|
+
plain_line " },"
|
708
|
+
plain_line " {"
|
709
|
+
expected_line %|- name: "Chevy 4x4"|
|
710
|
+
actual_line %|+ name: "Mattel Hoverboard"|
|
711
|
+
plain_line " }"
|
712
|
+
plain_line " ]"
|
713
|
+
plain_line " }"
|
714
|
+
end
|
715
|
+
)
|
626
716
|
|
627
|
-
expect(program).
|
628
|
-
|
629
|
-
|
717
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
718
|
+
color_enabled
|
719
|
+
)
|
630
720
|
end
|
631
721
|
end
|
632
722
|
|
@@ -656,26 +746,28 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
656
746
|
TEST
|
657
747
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
658
748
|
|
659
|
-
expected_output =
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
749
|
+
expected_output =
|
750
|
+
build_expected_output(
|
751
|
+
color_enabled: color_enabled,
|
752
|
+
snippet: "expect(value).not_to eq(value)",
|
753
|
+
newline_before_expectation: true,
|
754
|
+
expectation:
|
755
|
+
proc do
|
756
|
+
line do
|
757
|
+
plain " Expected "
|
758
|
+
actual %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, shipping_address: { line_1: "123 Main St.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Chevy 4x4" }] }|
|
759
|
+
end
|
760
|
+
|
761
|
+
line do
|
762
|
+
plain "not to eq "
|
763
|
+
expected %|{ customer: { person: #<SuperDiff::Test::Person name: "Marty McFly", age: 17>, shipping_address: { line_1: "123 Main St.", city: "Hill Valley", state: "CA", zip: "90382" } }, items: [{ name: "Fender Stratocaster", cost: 100000, options: ["red", "blue", "green"] }, { name: "Chevy 4x4" }] }|
|
764
|
+
end
|
765
|
+
end
|
766
|
+
)
|
675
767
|
|
676
|
-
expect(program).
|
677
|
-
|
678
|
-
|
768
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
769
|
+
color_enabled
|
770
|
+
)
|
679
771
|
end
|
680
772
|
end
|
681
773
|
end
|
@@ -684,39 +776,41 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
684
776
|
it "produces the correct failure message when used in the positive" do
|
685
777
|
as_both_colored_and_uncolored do |color_enabled|
|
686
778
|
snippet = <<~TEST.strip
|
687
|
-
|
688
|
-
name: "Marty",
|
689
|
-
age: 31,
|
690
|
-
)
|
691
|
-
actual = SuperDiff::Test::Customer.new(
|
779
|
+
actual = SuperDiff::Test::Customer.new(
|
692
780
|
name: "Doc",
|
693
781
|
shipping_address: :some_shipping_address,
|
694
782
|
phone: "1234567890",
|
695
783
|
)
|
784
|
+
expected = SuperDiff::Test::Person.new(
|
785
|
+
name: "Marty",
|
786
|
+
age: 31,
|
787
|
+
)
|
696
788
|
expect(actual).to eq(expected)
|
697
789
|
TEST
|
698
790
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
699
791
|
|
700
|
-
expected_output =
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
792
|
+
expected_output =
|
793
|
+
build_expected_output(
|
794
|
+
color_enabled: color_enabled,
|
795
|
+
snippet: "expect(actual).to eq(expected)",
|
796
|
+
newline_before_expectation: true,
|
797
|
+
expectation:
|
798
|
+
proc do
|
799
|
+
line do
|
800
|
+
plain "Expected "
|
801
|
+
actual %|#<SuperDiff::Test::Customer name: "Doc", shipping_address: :some_shipping_address, phone: "1234567890">|
|
802
|
+
end
|
803
|
+
|
804
|
+
line do
|
805
|
+
plain " to eq "
|
806
|
+
expected %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
807
|
+
end
|
808
|
+
end
|
809
|
+
)
|
716
810
|
|
717
|
-
expect(program).
|
718
|
-
|
719
|
-
|
811
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
812
|
+
color_enabled
|
813
|
+
)
|
720
814
|
end
|
721
815
|
end
|
722
816
|
|
@@ -731,26 +825,28 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
731
825
|
TEST
|
732
826
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
733
827
|
|
734
|
-
expected_output =
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
828
|
+
expected_output =
|
829
|
+
build_expected_output(
|
830
|
+
color_enabled: color_enabled,
|
831
|
+
snippet: "expect(value).not_to eq(value)",
|
832
|
+
newline_before_expectation: true,
|
833
|
+
expectation:
|
834
|
+
proc do
|
835
|
+
line do
|
836
|
+
plain " Expected "
|
837
|
+
actual %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
838
|
+
end
|
839
|
+
|
840
|
+
line do
|
841
|
+
plain "not to eq "
|
842
|
+
expected %|#<SuperDiff::Test::Person name: "Marty", age: 31>|
|
843
|
+
end
|
844
|
+
end
|
845
|
+
)
|
750
846
|
|
751
|
-
expect(program).
|
752
|
-
|
753
|
-
|
847
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
848
|
+
color_enabled
|
849
|
+
)
|
754
850
|
end
|
755
851
|
end
|
756
852
|
end
|
@@ -759,11 +855,7 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
759
855
|
it "produces the correct failure message when used in the positive" do
|
760
856
|
as_both_colored_and_uncolored do |color_enabled|
|
761
857
|
snippet = <<~TEST.strip
|
762
|
-
|
763
|
-
name: "camera",
|
764
|
-
quantity: 3,
|
765
|
-
)
|
766
|
-
actual = SuperDiff::Test::Player.new(
|
858
|
+
actual = SuperDiff::Test::Player.new(
|
767
859
|
handle: "mcmire",
|
768
860
|
character: "Jon",
|
769
861
|
inventory: ["sword"],
|
@@ -771,31 +863,36 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
771
863
|
health: 4,
|
772
864
|
ultimate: true,
|
773
865
|
)
|
866
|
+
expected = SuperDiff::Test::Item.new(
|
867
|
+
name: "camera",
|
868
|
+
quantity: 3,
|
869
|
+
)
|
774
870
|
expect(actual).to eq(expected)
|
775
871
|
TEST
|
776
872
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
777
873
|
|
778
|
-
expected_output =
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
874
|
+
expected_output =
|
875
|
+
build_expected_output(
|
876
|
+
color_enabled: color_enabled,
|
877
|
+
snippet: "expect(actual).to eq(expected)",
|
878
|
+
newline_before_expectation: true,
|
879
|
+
expectation:
|
880
|
+
proc do
|
881
|
+
line do
|
882
|
+
plain "Expected "
|
883
|
+
actual %|#<SuperDiff::Test::Player @character="Jon", @handle="mcmire", @health=4, @inventory=["sword"], @shields=11.4, @ultimate=true>|
|
884
|
+
end
|
885
|
+
|
886
|
+
line do
|
887
|
+
plain " to eq "
|
888
|
+
expected %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
889
|
+
end
|
890
|
+
end
|
891
|
+
)
|
794
892
|
|
795
|
-
expect(program).
|
796
|
-
|
797
|
-
|
798
|
-
removing_object_ids
|
893
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
894
|
+
color_enabled
|
895
|
+
).removing_object_ids
|
799
896
|
end
|
800
897
|
end
|
801
898
|
|
@@ -810,27 +907,28 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
810
907
|
TEST
|
811
908
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
812
909
|
|
813
|
-
expected_output =
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
910
|
+
expected_output =
|
911
|
+
build_expected_output(
|
912
|
+
color_enabled: color_enabled,
|
913
|
+
snippet: "expect(value).not_to eq(value)",
|
914
|
+
newline_before_expectation: true,
|
915
|
+
expectation:
|
916
|
+
proc do
|
917
|
+
line do
|
918
|
+
plain " Expected "
|
919
|
+
actual %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
920
|
+
end
|
921
|
+
|
922
|
+
line do
|
923
|
+
plain "not to eq "
|
924
|
+
expected %|#<SuperDiff::Test::Item @name="camera", @quantity=3>|
|
925
|
+
end
|
926
|
+
end
|
927
|
+
)
|
829
928
|
|
830
|
-
expect(program).
|
831
|
-
|
832
|
-
|
833
|
-
removing_object_ids
|
929
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
930
|
+
color_enabled
|
931
|
+
).removing_object_ids
|
834
932
|
end
|
835
933
|
end
|
836
934
|
end
|
@@ -839,36 +937,39 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
839
937
|
it "formats the array correctly in the diff" do
|
840
938
|
as_both_colored_and_uncolored do |color_enabled|
|
841
939
|
snippet = <<~TEST.strip
|
940
|
+
actual = { foo: [] }
|
842
941
|
expected = { foo: nil }
|
843
|
-
actual = { foo: [] }
|
844
942
|
expect(actual).to eq(expected)
|
845
943
|
TEST
|
846
944
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
847
945
|
|
848
|
-
expected_output =
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
946
|
+
expected_output =
|
947
|
+
build_expected_output(
|
948
|
+
color_enabled: color_enabled,
|
949
|
+
snippet: "expect(actual).to eq(expected)",
|
950
|
+
newline_before_expectation: true,
|
951
|
+
expectation:
|
952
|
+
proc do
|
953
|
+
line do
|
954
|
+
plain "Expected "
|
955
|
+
actual "{ foo: [] }"
|
956
|
+
plain " to eq "
|
957
|
+
expected "{ foo: nil }"
|
958
|
+
plain "."
|
959
|
+
end
|
960
|
+
end,
|
961
|
+
diff:
|
962
|
+
proc do
|
963
|
+
plain_line " {"
|
964
|
+
expected_line "- foo: nil"
|
965
|
+
actual_line "+ foo: []"
|
966
|
+
plain_line " }"
|
967
|
+
end
|
968
|
+
)
|
868
969
|
|
869
|
-
expect(program).
|
870
|
-
|
871
|
-
|
970
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
971
|
+
color_enabled
|
972
|
+
)
|
872
973
|
end
|
873
974
|
end
|
874
975
|
end
|
@@ -877,36 +978,39 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
877
978
|
it "formats the hash correctly in the diff" do
|
878
979
|
as_both_colored_and_uncolored do |color_enabled|
|
879
980
|
snippet = <<~TEST.strip
|
981
|
+
actual = { foo: {} }
|
880
982
|
expected = { foo: nil }
|
881
|
-
actual = { foo: {} }
|
882
983
|
expect(actual).to eq(expected)
|
883
984
|
TEST
|
884
985
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
885
986
|
|
886
|
-
expected_output =
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
987
|
+
expected_output =
|
988
|
+
build_expected_output(
|
989
|
+
color_enabled: color_enabled,
|
990
|
+
snippet: "expect(actual).to eq(expected)",
|
991
|
+
newline_before_expectation: true,
|
992
|
+
expectation:
|
993
|
+
proc do
|
994
|
+
line do
|
995
|
+
plain "Expected "
|
996
|
+
actual "{ foo: {} }"
|
997
|
+
plain " to eq "
|
998
|
+
expected "{ foo: nil }"
|
999
|
+
plain "."
|
1000
|
+
end
|
1001
|
+
end,
|
1002
|
+
diff:
|
1003
|
+
proc do
|
1004
|
+
plain_line " {"
|
1005
|
+
expected_line "- foo: nil"
|
1006
|
+
actual_line "+ foo: {}"
|
1007
|
+
plain_line " }"
|
1008
|
+
end
|
1009
|
+
)
|
906
1010
|
|
907
|
-
expect(program).
|
908
|
-
|
909
|
-
|
1011
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
1012
|
+
color_enabled
|
1013
|
+
)
|
910
1014
|
end
|
911
1015
|
end
|
912
1016
|
end
|
@@ -915,37 +1019,39 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
915
1019
|
it "formats the object correctly in the diff" do
|
916
1020
|
as_both_colored_and_uncolored do |color_enabled|
|
917
1021
|
snippet = <<~TEST.strip
|
1022
|
+
actual = { foo: SuperDiff::Test::EmptyClass.new }
|
918
1023
|
expected = { foo: nil }
|
919
|
-
actual = { foo: SuperDiff::Test::EmptyClass.new }
|
920
1024
|
expect(actual).to eq(expected)
|
921
1025
|
TEST
|
922
1026
|
program = make_plain_test_program(snippet, color_enabled: color_enabled)
|
923
1027
|
|
924
|
-
expected_output =
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
1028
|
+
expected_output =
|
1029
|
+
build_expected_output(
|
1030
|
+
color_enabled: color_enabled,
|
1031
|
+
snippet: "expect(actual).to eq(expected)",
|
1032
|
+
newline_before_expectation: true,
|
1033
|
+
expectation:
|
1034
|
+
proc do
|
1035
|
+
line do
|
1036
|
+
plain "Expected "
|
1037
|
+
actual "{ foo: #<SuperDiff::Test::EmptyClass> }"
|
1038
|
+
plain " to eq "
|
1039
|
+
expected "{ foo: nil }"
|
1040
|
+
plain "."
|
1041
|
+
end
|
1042
|
+
end,
|
1043
|
+
diff:
|
1044
|
+
proc do
|
1045
|
+
plain_line " {"
|
1046
|
+
expected_line "- foo: nil"
|
1047
|
+
actual_line "+ foo: #<SuperDiff::Test::EmptyClass>"
|
1048
|
+
plain_line " }"
|
1049
|
+
end
|
1050
|
+
)
|
944
1051
|
|
945
|
-
expect(program).
|
946
|
-
|
947
|
-
|
948
|
-
removing_object_ids
|
1052
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
1053
|
+
color_enabled
|
1054
|
+
).removing_object_ids
|
949
1055
|
end
|
950
1056
|
end
|
951
1057
|
end
|
@@ -953,4 +1059,8 @@ RSpec.describe "Integration with RSpec's #eq matcher", type: :integration do
|
|
953
1059
|
it_behaves_like "a matcher that supports elided diffs" do
|
954
1060
|
let(:matcher) { :eq }
|
955
1061
|
end
|
1062
|
+
|
1063
|
+
it_behaves_like "a matcher that supports a toggleable key" do
|
1064
|
+
let(:matcher) { :eq }
|
1065
|
+
end
|
956
1066
|
end
|