super_diff 0.8.0 → 0.10.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 +5 -13
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb +1 -3
- 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 +3 -9
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb +1 -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 -11
- 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/default_object.rb +1 -1
- data/lib/super_diff/differs/defaults.rb +1 -1
- data/lib/super_diff/differs/main.rb +2 -13
- 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 +3 -3
- data/lib/super_diff/gem_version.rb +3 -3
- data/lib/super_diff/helpers.rb +11 -7
- 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 +46 -60
- data/lib/super_diff/object_inspection/inspection_tree_builders/array.rb +2 -6
- data/lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb +3 -9
- data/lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb +5 -14
- data/lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb +1 -1
- data/lib/super_diff/object_inspection/inspection_tree_builders/hash.rb +4 -12
- data/lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb +6 -23
- data/lib/super_diff/object_inspection/inspection_tree_builders.rb +9 -9
- data/lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb +8 -20
- 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/default_object.rb +29 -21
- 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 +1 -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 +1 -5
- 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 +122 -116
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +8 -6
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +11 -16
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +2 -1
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +8 -6
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +8 -6
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +9 -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 +11 -13
- 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 +5 -9
- data/spec/examples.txt +493 -407
- data/spec/integration/rails/active_record_spec.rb +3 -1
- data/spec/integration/rails/engines_spec.rb +20 -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 +242 -239
- data/spec/integration/rspec/eq_matcher_spec.rb +595 -557
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +294 -286
- data/spec/integration/rspec/have_predicate_matcher_spec.rb +291 -297
- data/spec/integration/rspec/include_matcher_spec.rb +317 -215
- data/spec/integration/rspec/match_array_matcher_spec.rb +276 -273
- data/spec/integration/rspec/match_matcher_spec.rb +847 -834
- data/spec/integration/rspec/raise_error_matcher_spec.rb +468 -453
- 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/spec_helper.rb +17 -20
- data/spec/support/command_runner.rb +34 -57
- data/spec/support/integration/helpers.rb +35 -28
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +28 -23
- data/spec/support/integration/test_programs/base.rb +12 -17
- 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 +30 -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 +232 -214
- data/spec/support/shared_examples/active_support.rb +53 -51
- data/spec/support/shared_examples/elided_diffs.rb +405 -381
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +424 -388
- 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/equality_matchers/main_spec.rb +1049 -984
- data/spec/unit/helpers_spec.rb +27 -20
- 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 +5 -5
- data/spec/unit/rspec/matchers/respond_to_spec.rb +23 -16
- data/spec/unit/rspec/object_inspection_spec.rb +349 -324
- data/spec/unit/super_diff_spec.rb +1542 -1449
- 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 +70 -68
@@ -10,23 +10,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
10
10
|
expect(true).to be(false)
|
11
11
|
TEST
|
12
12
|
|
13
|
-
expected_output =
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
13
|
+
expected_output =
|
14
|
+
build_expected_output(
|
15
|
+
color_enabled: color_enabled,
|
16
|
+
snippet: "expect(true).to be(false)",
|
17
|
+
expectation:
|
18
|
+
proc do
|
19
|
+
line do
|
20
|
+
plain "Expected "
|
21
|
+
actual "true"
|
22
|
+
plain " to equal "
|
23
|
+
expected "false"
|
24
|
+
plain "."
|
25
|
+
end
|
26
|
+
end
|
27
|
+
)
|
28
|
+
|
29
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
30
|
+
color_enabled
|
25
31
|
)
|
26
|
-
|
27
|
-
expect(program).
|
28
|
-
to produce_output_when_run(expected_output).
|
29
|
-
in_color(color_enabled)
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
@@ -37,23 +39,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
37
39
|
expect(false).not_to be(false)
|
38
40
|
TEST
|
39
41
|
|
40
|
-
expected_output =
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
expected_output =
|
43
|
+
build_expected_output(
|
44
|
+
color_enabled: color_enabled,
|
45
|
+
snippet: "expect(false).not_to be(false)",
|
46
|
+
expectation:
|
47
|
+
proc do
|
48
|
+
line do
|
49
|
+
plain "Expected "
|
50
|
+
actual "false"
|
51
|
+
plain " not to equal "
|
52
|
+
expected "false"
|
53
|
+
plain "."
|
54
|
+
end
|
55
|
+
end
|
56
|
+
)
|
57
|
+
|
58
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
59
|
+
color_enabled
|
52
60
|
)
|
53
|
-
|
54
|
-
expect(program).
|
55
|
-
to produce_output_when_run(expected_output).
|
56
|
-
in_color(color_enabled)
|
57
61
|
end
|
58
62
|
end
|
59
63
|
end
|
@@ -66,23 +70,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
66
70
|
expect(false).to be(true)
|
67
71
|
TEST
|
68
72
|
|
69
|
-
expected_output =
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
73
|
+
expected_output =
|
74
|
+
build_expected_output(
|
75
|
+
color_enabled: color_enabled,
|
76
|
+
snippet: "expect(false).to be(true)",
|
77
|
+
expectation:
|
78
|
+
proc do
|
79
|
+
line do
|
80
|
+
plain "Expected "
|
81
|
+
actual "false"
|
82
|
+
plain " to equal "
|
83
|
+
expected "true"
|
84
|
+
plain "."
|
85
|
+
end
|
86
|
+
end
|
87
|
+
)
|
88
|
+
|
89
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
90
|
+
color_enabled
|
81
91
|
)
|
82
|
-
|
83
|
-
expect(program).
|
84
|
-
to produce_output_when_run(expected_output).
|
85
|
-
in_color(color_enabled)
|
86
92
|
end
|
87
93
|
end
|
88
94
|
|
@@ -93,23 +99,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
93
99
|
expect(true).not_to be(true)
|
94
100
|
TEST
|
95
101
|
|
96
|
-
expected_output =
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
102
|
+
expected_output =
|
103
|
+
build_expected_output(
|
104
|
+
color_enabled: color_enabled,
|
105
|
+
snippet: "expect(true).not_to be(true)",
|
106
|
+
expectation:
|
107
|
+
proc do
|
108
|
+
line do
|
109
|
+
plain "Expected "
|
110
|
+
actual "true"
|
111
|
+
plain " not to equal "
|
112
|
+
expected "true"
|
113
|
+
plain "."
|
114
|
+
end
|
115
|
+
end
|
116
|
+
)
|
117
|
+
|
118
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
119
|
+
color_enabled
|
108
120
|
)
|
109
|
-
|
110
|
-
expect(program).
|
111
|
-
to produce_output_when_run(expected_output).
|
112
|
-
in_color(color_enabled)
|
113
121
|
end
|
114
122
|
end
|
115
123
|
end
|
@@ -123,23 +131,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
123
131
|
expect(nil).to be
|
124
132
|
TEST
|
125
133
|
|
126
|
-
expected_output =
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
134
|
+
expected_output =
|
135
|
+
build_expected_output(
|
136
|
+
color_enabled: color_enabled,
|
137
|
+
snippet: "expect(nil).to be",
|
138
|
+
expectation:
|
139
|
+
proc do
|
140
|
+
line do
|
141
|
+
plain "Expected "
|
142
|
+
actual "nil"
|
143
|
+
plain " to be "
|
144
|
+
expected "truthy"
|
145
|
+
plain "."
|
146
|
+
end
|
147
|
+
end
|
148
|
+
)
|
139
149
|
|
140
|
-
expect(program).
|
141
|
-
|
142
|
-
|
150
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
151
|
+
color_enabled
|
152
|
+
)
|
143
153
|
end
|
144
154
|
end
|
145
155
|
|
@@ -150,23 +160,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
150
160
|
expect(:something).not_to be
|
151
161
|
TEST
|
152
162
|
|
153
|
-
expected_output =
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
163
|
+
expected_output =
|
164
|
+
build_expected_output(
|
165
|
+
color_enabled: color_enabled,
|
166
|
+
snippet: "expect(:something).not_to be",
|
167
|
+
expectation:
|
168
|
+
proc do
|
169
|
+
line do
|
170
|
+
plain "Expected "
|
171
|
+
actual ":something"
|
172
|
+
plain " not to be "
|
173
|
+
expected "truthy"
|
174
|
+
plain "."
|
175
|
+
end
|
176
|
+
end
|
177
|
+
)
|
166
178
|
|
167
|
-
expect(program).
|
168
|
-
|
169
|
-
|
179
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
180
|
+
color_enabled
|
181
|
+
)
|
170
182
|
end
|
171
183
|
end
|
172
184
|
end
|
@@ -179,23 +191,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
179
191
|
expect(nil).to be == :foo
|
180
192
|
TEST
|
181
193
|
|
182
|
-
expected_output =
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
194
|
+
expected_output =
|
195
|
+
build_expected_output(
|
196
|
+
color_enabled: color_enabled,
|
197
|
+
snippet: "expect(nil).to be == :foo",
|
198
|
+
expectation:
|
199
|
+
proc do
|
200
|
+
line do
|
201
|
+
plain "Expected "
|
202
|
+
actual "nil"
|
203
|
+
plain " to == "
|
204
|
+
expected ":foo"
|
205
|
+
plain "."
|
206
|
+
end
|
207
|
+
end
|
208
|
+
)
|
195
209
|
|
196
|
-
expect(program).
|
197
|
-
|
198
|
-
|
210
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
211
|
+
color_enabled
|
212
|
+
)
|
199
213
|
end
|
200
214
|
end
|
201
215
|
|
@@ -206,23 +220,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
206
220
|
expect(:foo).not_to be == :foo
|
207
221
|
TEST
|
208
222
|
|
209
|
-
expected_output =
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
223
|
+
expected_output =
|
224
|
+
build_expected_output(
|
225
|
+
color_enabled: color_enabled,
|
226
|
+
snippet: "expect(:foo).not_to be == :foo",
|
227
|
+
expectation:
|
228
|
+
proc do
|
229
|
+
line do
|
230
|
+
plain "Expected "
|
231
|
+
actual ":foo"
|
232
|
+
plain " not to == "
|
233
|
+
expected ":foo"
|
234
|
+
plain "."
|
235
|
+
end
|
236
|
+
end
|
237
|
+
)
|
222
238
|
|
223
|
-
expect(program).
|
224
|
-
|
225
|
-
|
239
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
240
|
+
color_enabled
|
241
|
+
)
|
226
242
|
end
|
227
243
|
end
|
228
244
|
end
|
@@ -235,23 +251,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
235
251
|
expect(1).to be < 1
|
236
252
|
TEST
|
237
253
|
|
238
|
-
expected_output =
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
254
|
+
expected_output =
|
255
|
+
build_expected_output(
|
256
|
+
color_enabled: color_enabled,
|
257
|
+
snippet: "expect(1).to be < 1",
|
258
|
+
expectation:
|
259
|
+
proc do
|
260
|
+
line do
|
261
|
+
plain "Expected "
|
262
|
+
actual "1"
|
263
|
+
plain " to be < "
|
264
|
+
expected "1"
|
265
|
+
plain "."
|
266
|
+
end
|
267
|
+
end
|
268
|
+
)
|
251
269
|
|
252
|
-
expect(program).
|
253
|
-
|
254
|
-
|
270
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
271
|
+
color_enabled
|
272
|
+
)
|
255
273
|
end
|
256
274
|
end
|
257
275
|
|
@@ -262,23 +280,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
262
280
|
expect(0).not_to be < 1
|
263
281
|
TEST
|
264
282
|
|
265
|
-
expected_output =
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
283
|
+
expected_output =
|
284
|
+
build_expected_output(
|
285
|
+
color_enabled: color_enabled,
|
286
|
+
snippet: "expect(0).not_to be < 1",
|
287
|
+
expectation:
|
288
|
+
proc do
|
289
|
+
line do
|
290
|
+
plain "Expected "
|
291
|
+
actual "0"
|
292
|
+
plain " not to be < "
|
293
|
+
expected "1"
|
294
|
+
plain "."
|
295
|
+
end
|
296
|
+
end
|
297
|
+
)
|
278
298
|
|
279
|
-
expect(program).
|
280
|
-
|
281
|
-
|
299
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
300
|
+
color_enabled
|
301
|
+
)
|
282
302
|
end
|
283
303
|
end
|
284
304
|
end
|
@@ -291,23 +311,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
291
311
|
expect(1).to be <= 0
|
292
312
|
TEST
|
293
313
|
|
294
|
-
expected_output =
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
314
|
+
expected_output =
|
315
|
+
build_expected_output(
|
316
|
+
color_enabled: color_enabled,
|
317
|
+
snippet: "expect(1).to be <= 0",
|
318
|
+
expectation:
|
319
|
+
proc do
|
320
|
+
line do
|
321
|
+
plain "Expected "
|
322
|
+
actual "1"
|
323
|
+
plain " to be <= "
|
324
|
+
expected "0"
|
325
|
+
plain "."
|
326
|
+
end
|
327
|
+
end
|
328
|
+
)
|
307
329
|
|
308
|
-
expect(program).
|
309
|
-
|
310
|
-
|
330
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
331
|
+
color_enabled
|
332
|
+
)
|
311
333
|
end
|
312
334
|
end
|
313
335
|
|
@@ -318,23 +340,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
318
340
|
expect(0).not_to be <= 0
|
319
341
|
TEST
|
320
342
|
|
321
|
-
expected_output =
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
343
|
+
expected_output =
|
344
|
+
build_expected_output(
|
345
|
+
color_enabled: color_enabled,
|
346
|
+
snippet: "expect(0).not_to be <= 0",
|
347
|
+
expectation:
|
348
|
+
proc do
|
349
|
+
line do
|
350
|
+
plain "Expected "
|
351
|
+
actual "0"
|
352
|
+
plain " not to be <= "
|
353
|
+
expected "0"
|
354
|
+
plain "."
|
355
|
+
end
|
356
|
+
end
|
357
|
+
)
|
334
358
|
|
335
|
-
expect(program).
|
336
|
-
|
337
|
-
|
359
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
360
|
+
color_enabled
|
361
|
+
)
|
338
362
|
end
|
339
363
|
end
|
340
364
|
end
|
@@ -347,23 +371,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
347
371
|
expect(1).to be >= 2
|
348
372
|
TEST
|
349
373
|
|
350
|
-
expected_output =
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
374
|
+
expected_output =
|
375
|
+
build_expected_output(
|
376
|
+
color_enabled: color_enabled,
|
377
|
+
snippet: "expect(1).to be >= 2",
|
378
|
+
expectation:
|
379
|
+
proc do
|
380
|
+
line do
|
381
|
+
plain "Expected "
|
382
|
+
actual "1"
|
383
|
+
plain " to be >= "
|
384
|
+
expected "2"
|
385
|
+
plain "."
|
386
|
+
end
|
387
|
+
end
|
388
|
+
)
|
363
389
|
|
364
|
-
expect(program).
|
365
|
-
|
366
|
-
|
390
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
391
|
+
color_enabled
|
392
|
+
)
|
367
393
|
end
|
368
394
|
end
|
369
395
|
|
@@ -374,23 +400,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
374
400
|
expect(2).not_to be >= 2
|
375
401
|
TEST
|
376
402
|
|
377
|
-
expected_output =
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
403
|
+
expected_output =
|
404
|
+
build_expected_output(
|
405
|
+
color_enabled: color_enabled,
|
406
|
+
snippet: "expect(2).not_to be >= 2",
|
407
|
+
expectation:
|
408
|
+
proc do
|
409
|
+
line do
|
410
|
+
plain "Expected "
|
411
|
+
actual "2"
|
412
|
+
plain " not to be >= "
|
413
|
+
expected "2"
|
414
|
+
plain "."
|
415
|
+
end
|
416
|
+
end
|
417
|
+
)
|
390
418
|
|
391
|
-
expect(program).
|
392
|
-
|
393
|
-
|
419
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
420
|
+
color_enabled
|
421
|
+
)
|
394
422
|
end
|
395
423
|
end
|
396
424
|
end
|
@@ -403,23 +431,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
403
431
|
expect(1).to be > 2
|
404
432
|
TEST
|
405
433
|
|
406
|
-
expected_output =
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
434
|
+
expected_output =
|
435
|
+
build_expected_output(
|
436
|
+
color_enabled: color_enabled,
|
437
|
+
snippet: "expect(1).to be > 2",
|
438
|
+
expectation:
|
439
|
+
proc do
|
440
|
+
line do
|
441
|
+
plain "Expected "
|
442
|
+
actual "1"
|
443
|
+
plain " to be > "
|
444
|
+
expected "2"
|
445
|
+
plain "."
|
446
|
+
end
|
447
|
+
end
|
448
|
+
)
|
419
449
|
|
420
|
-
expect(program).
|
421
|
-
|
422
|
-
|
450
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
451
|
+
color_enabled
|
452
|
+
)
|
423
453
|
end
|
424
454
|
end
|
425
455
|
|
@@ -430,23 +460,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
430
460
|
expect(3).not_to be > 2
|
431
461
|
TEST
|
432
462
|
|
433
|
-
expected_output =
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
463
|
+
expected_output =
|
464
|
+
build_expected_output(
|
465
|
+
color_enabled: color_enabled,
|
466
|
+
snippet: "expect(3).not_to be > 2",
|
467
|
+
expectation:
|
468
|
+
proc do
|
469
|
+
line do
|
470
|
+
plain "Expected "
|
471
|
+
actual "3"
|
472
|
+
plain " not to be > "
|
473
|
+
expected "2"
|
474
|
+
plain "."
|
475
|
+
end
|
476
|
+
end
|
477
|
+
)
|
446
478
|
|
447
|
-
expect(program).
|
448
|
-
|
449
|
-
|
479
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
480
|
+
color_enabled
|
481
|
+
)
|
450
482
|
end
|
451
483
|
end
|
452
484
|
end
|
@@ -459,23 +491,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
459
491
|
expect(String).to be === :foo
|
460
492
|
TEST
|
461
493
|
|
462
|
-
expected_output =
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
494
|
+
expected_output =
|
495
|
+
build_expected_output(
|
496
|
+
color_enabled: color_enabled,
|
497
|
+
snippet: "expect(String).to be === :foo",
|
498
|
+
expectation:
|
499
|
+
proc do
|
500
|
+
line do
|
501
|
+
plain "Expected "
|
502
|
+
actual "String"
|
503
|
+
plain " to === "
|
504
|
+
expected ":foo"
|
505
|
+
plain "."
|
506
|
+
end
|
507
|
+
end
|
508
|
+
)
|
475
509
|
|
476
|
-
expect(program).
|
477
|
-
|
478
|
-
|
510
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
511
|
+
color_enabled
|
512
|
+
)
|
479
513
|
end
|
480
514
|
end
|
481
515
|
|
@@ -486,23 +520,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
486
520
|
expect(String).not_to be === "foo"
|
487
521
|
TEST
|
488
522
|
|
489
|
-
expected_output =
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
523
|
+
expected_output =
|
524
|
+
build_expected_output(
|
525
|
+
color_enabled: color_enabled,
|
526
|
+
snippet: %|expect(String).not_to be === "foo"|,
|
527
|
+
expectation:
|
528
|
+
proc do
|
529
|
+
line do
|
530
|
+
plain "Expected "
|
531
|
+
actual "String"
|
532
|
+
plain " not to === "
|
533
|
+
expected %|"foo"|
|
534
|
+
plain "."
|
535
|
+
end
|
536
|
+
end
|
537
|
+
)
|
502
538
|
|
503
|
-
expect(program).
|
504
|
-
|
505
|
-
|
539
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
540
|
+
color_enabled
|
541
|
+
)
|
506
542
|
end
|
507
543
|
end
|
508
544
|
end
|
@@ -515,23 +551,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
515
551
|
expect("foo").to be =~ /bar/
|
516
552
|
TEST
|
517
553
|
|
518
|
-
expected_output =
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
554
|
+
expected_output =
|
555
|
+
build_expected_output(
|
556
|
+
color_enabled: color_enabled,
|
557
|
+
snippet: %|expect("foo").to be =~ /bar/|,
|
558
|
+
expectation:
|
559
|
+
proc do
|
560
|
+
line do
|
561
|
+
plain "Expected "
|
562
|
+
actual %|"foo"|
|
563
|
+
plain " to =~ "
|
564
|
+
expected "/bar/"
|
565
|
+
plain "."
|
566
|
+
end
|
567
|
+
end
|
568
|
+
)
|
531
569
|
|
532
|
-
expect(program).
|
533
|
-
|
534
|
-
|
570
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
571
|
+
color_enabled
|
572
|
+
)
|
535
573
|
end
|
536
574
|
end
|
537
575
|
|
@@ -542,23 +580,25 @@ RSpec.describe "Integration with RSpec's #be matcher", type: :integration do
|
|
542
580
|
expect("bar").not_to be =~ /bar/
|
543
581
|
TEST
|
544
582
|
|
545
|
-
expected_output =
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
583
|
+
expected_output =
|
584
|
+
build_expected_output(
|
585
|
+
color_enabled: color_enabled,
|
586
|
+
snippet: %|expect("bar").not_to be =~ /bar/|,
|
587
|
+
expectation:
|
588
|
+
proc do
|
589
|
+
line do
|
590
|
+
plain "Expected "
|
591
|
+
actual %|"bar"|
|
592
|
+
plain " not to =~ "
|
593
|
+
expected "/bar/"
|
594
|
+
plain "."
|
595
|
+
end
|
596
|
+
end
|
597
|
+
)
|
558
598
|
|
559
|
-
expect(program).
|
560
|
-
|
561
|
-
|
599
|
+
expect(program).to produce_output_when_run(expected_output).in_color(
|
600
|
+
color_enabled
|
601
|
+
)
|
562
602
|
end
|
563
603
|
end
|
564
604
|
end
|