super_diff 0.5.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +46 -20
- data/lib/super_diff.rb +46 -7
- data/lib/super_diff/active_record.rb +7 -7
- data/lib/super_diff/active_record/differs/active_record_relation.rb +3 -13
- data/lib/super_diff/active_record/object_inspection.rb +2 -6
- data/lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb +16 -0
- data/lib/super_diff/active_record/object_inspection/{inspectors → inspection_tree_builders}/active_record_model.rb +19 -20
- data/lib/super_diff/active_record/object_inspection/{inspectors → inspection_tree_builders}/active_record_relation.rb +9 -8
- data/lib/super_diff/active_record/operation_tree_flatteners.rb +10 -0
- data/lib/super_diff/active_record/operation_tree_flatteners/active_record_relation.rb +17 -0
- data/lib/super_diff/active_record/operation_trees/active_record_relation.rb +8 -7
- data/lib/super_diff/active_support.rb +8 -8
- data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -13
- data/lib/super_diff/active_support/object_inspection.rb +2 -6
- data/lib/super_diff/active_support/object_inspection/{inspectors.rb → inspection_tree_builders.rb} +2 -2
- data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb +37 -0
- data/lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb +17 -0
- data/lib/super_diff/active_support/operation_tree_flatteners.rb +10 -0
- data/lib/super_diff/active_support/operation_tree_flatteners/hash_with_indifferent_access.rb +17 -0
- data/lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb +4 -7
- data/lib/super_diff/colorized_document_extensions.rb +9 -6
- data/lib/super_diff/configuration.rb +102 -19
- data/lib/super_diff/csi.rb +1 -1
- data/lib/super_diff/csi/four_bit_color.rb +0 -2
- data/lib/super_diff/diff_formatters/collection.rb +2 -2
- data/lib/super_diff/diff_formatters/multiline_string.rb +4 -4
- data/lib/super_diff/differs/array.rb +1 -1
- data/lib/super_diff/differs/base.rb +3 -21
- data/lib/super_diff/differs/custom_object.rb +1 -1
- data/lib/super_diff/differs/default_object.rb +1 -1
- data/lib/super_diff/differs/hash.rb +1 -1
- data/lib/super_diff/differs/main.rb +1 -7
- data/lib/super_diff/differs/multiline_string.rb +1 -1
- data/lib/super_diff/differs/time_like.rb +1 -1
- data/lib/super_diff/equality_matchers/array.rb +4 -4
- data/lib/super_diff/equality_matchers/default.rb +4 -4
- data/lib/super_diff/equality_matchers/hash.rb +4 -4
- data/lib/super_diff/equality_matchers/multiline_string.rb +4 -4
- data/lib/super_diff/equality_matchers/primitive.rb +6 -9
- data/lib/super_diff/equality_matchers/singleline_string.rb +4 -4
- data/lib/super_diff/gem_version.rb +45 -0
- data/lib/super_diff/helpers.rb +52 -2
- data/lib/super_diff/line.rb +83 -0
- data/lib/super_diff/object_inspection.rb +12 -9
- data/lib/super_diff/object_inspection/inspection_tree.rb +183 -81
- data/lib/super_diff/object_inspection/inspection_tree_builders.rb +44 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/array.rb +38 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/base.rb +27 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb +37 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb +63 -0
- data/lib/super_diff/object_inspection/{inspectors → inspection_tree_builders}/defaults.rb +1 -2
- data/lib/super_diff/object_inspection/inspection_tree_builders/hash.rb +46 -0
- data/lib/super_diff/object_inspection/{inspectors → inspection_tree_builders}/main.rb +5 -10
- data/lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb +21 -0
- data/lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb +64 -0
- data/lib/super_diff/object_inspection/nodes.rb +33 -32
- data/lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb +97 -0
- data/lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/as_single_line.rb +33 -0
- data/lib/super_diff/object_inspection/nodes/base.rb +55 -20
- data/lib/super_diff/object_inspection/nodes/inspection.rb +47 -7
- data/lib/super_diff/object_inspection/nodes/nesting.rb +16 -5
- data/lib/super_diff/object_inspection/nodes/only_when.rb +54 -0
- data/lib/super_diff/object_inspection/nodes/text.rb +16 -2
- data/lib/super_diff/object_inspection/nodes/when_empty.rb +21 -6
- data/lib/super_diff/object_inspection/nodes/when_non_empty.rb +20 -5
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb +27 -0
- data/lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb +27 -0
- data/lib/super_diff/object_inspection/prefix_for_next_node.rb +6 -0
- data/lib/super_diff/object_inspection/prelude_for_next_node.rb +6 -0
- data/lib/super_diff/operation_tree_builders/array.rb +7 -10
- data/lib/super_diff/operation_tree_builders/base.rb +6 -6
- data/lib/super_diff/operation_tree_builders/custom_object.rb +5 -2
- data/lib/super_diff/operation_tree_builders/default_object.rb +1 -1
- data/lib/super_diff/operation_tree_builders/defaults.rb +1 -1
- data/lib/super_diff/operation_tree_builders/hash.rb +1 -8
- data/lib/super_diff/operation_tree_builders/multiline_string.rb +2 -6
- data/lib/super_diff/operation_tree_builders/time_like.rb +2 -2
- data/lib/super_diff/operation_tree_flatteners.rb +20 -0
- data/lib/super_diff/operation_tree_flatteners/array.rb +15 -0
- data/lib/super_diff/operation_tree_flatteners/base.rb +54 -0
- data/lib/super_diff/operation_tree_flatteners/collection.rb +139 -0
- data/lib/super_diff/operation_tree_flatteners/custom_object.rb +28 -0
- data/lib/super_diff/operation_tree_flatteners/default_object.rb +32 -0
- data/lib/super_diff/operation_tree_flatteners/hash.rb +41 -0
- data/lib/super_diff/operation_tree_flatteners/multiline_string.rb +17 -0
- data/lib/super_diff/operation_trees/array.rb +4 -7
- data/lib/super_diff/operation_trees/base.rb +39 -16
- data/lib/super_diff/operation_trees/custom_object.rb +4 -8
- data/lib/super_diff/operation_trees/default_object.rb +28 -13
- data/lib/super_diff/operation_trees/hash.rb +4 -7
- data/lib/super_diff/operation_trees/main.rb +1 -1
- data/lib/super_diff/operation_trees/multiline_string.rb +4 -7
- data/lib/super_diff/operations/binary_operation.rb +1 -6
- data/lib/super_diff/operations/unary_operation.rb +2 -30
- data/lib/super_diff/recursion_guard.rb +3 -3
- data/lib/super_diff/rspec.rb +41 -13
- data/lib/super_diff/rspec/differs/collection_including.rb +4 -2
- data/lib/super_diff/rspec/differs/hash_including.rb +4 -2
- data/lib/super_diff/rspec/matcher_text_builders/base.rb +7 -7
- data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +6 -6
- data/lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +4 -4
- data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +5 -5
- data/lib/super_diff/rspec/monkey_patches.rb +353 -306
- data/lib/super_diff/rspec/object_inspection.rb +4 -1
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +44 -0
- data/lib/super_diff/rspec/object_inspection/{inspectors → inspection_tree_builders}/collection_containing_exactly.rb +9 -8
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +34 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +103 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +36 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +26 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +26 -0
- data/lib/super_diff/rspec/object_inspection/{inspectors → inspection_tree_builders}/object_having_attributes.rb +10 -12
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/primitive.rb +10 -0
- data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb +33 -0
- data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +12 -4
- data/lib/super_diff/rspec/operation_tree_builders/collection_including.rb +10 -3
- data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +10 -3
- data/lib/super_diff/tiered_lines.rb +4 -0
- data/lib/super_diff/tiered_lines_elider.rb +490 -0
- data/lib/super_diff/tiered_lines_formatter.rb +79 -0
- data/lib/super_diff/version.rb +1 -1
- data/spec/examples.txt +407 -5
- data/spec/integration/rails/active_support_spec.rb +19 -0
- data/spec/integration/rspec/be_falsey_matcher_spec.rb +10 -10
- data/spec/integration/rspec/be_matcher_spec.rb +100 -100
- data/spec/integration/rspec/be_nil_matcher_spec.rb +10 -10
- data/spec/integration/rspec/be_predicate_matcher_spec.rb +103 -103
- data/spec/integration/rspec/be_truthy_matcher_spec.rb +10 -10
- data/spec/integration/rspec/contain_exactly_matcher_spec.rb +113 -107
- data/spec/integration/rspec/eq_matcher_spec.rb +223 -277
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +138 -129
- data/spec/integration/rspec/have_predicate_matcher_spec.rb +65 -65
- data/spec/integration/rspec/include_matcher_spec.rb +73 -73
- data/spec/integration/rspec/match_array_matcher_spec.rb +126 -119
- data/spec/integration/rspec/match_matcher_spec.rb +362 -274
- data/spec/integration/rspec/raise_error_matcher_spec.rb +86 -86
- data/spec/integration/rspec/respond_to_matcher_spec.rb +240 -240
- data/spec/integration/rspec/third_party_matcher_spec.rb +8 -8
- data/spec/integration/rspec/unhandled_errors_spec.rb +5 -5
- data/spec/spec_helper.rb +33 -13
- data/spec/support/command_runner.rb +15 -25
- data/spec/support/helpers.rb +21 -0
- data/spec/support/integration/helpers.rb +8 -2
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +4 -4
- data/spec/support/integration/test_programs/base.rb +38 -10
- data/spec/support/integration/test_programs/rspec_active_record.rb +1 -1
- data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
- data/spec/support/integration/test_programs/rspec_rails.rb +1 -1
- data/spec/support/shared_examples/active_record.rb +109 -108
- data/spec/support/shared_examples/active_support.rb +65 -0
- data/spec/support/shared_examples/elided_diffs.rb +914 -0
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
- data/spec/support/unit/helpers.rb +15 -0
- data/spec/support/unit/matchers/match_output.rb +41 -0
- data/spec/unit/active_record/object_inspection_spec.rb +273 -0
- data/spec/unit/equality_matchers/main_spec.rb +445 -465
- data/spec/unit/helpers_spec.rb +61 -0
- data/spec/unit/operation_tree_flatteners/array_spec.rb +604 -0
- data/spec/unit/operation_tree_flatteners/custom_object_spec.rb +667 -0
- data/spec/unit/operation_tree_flatteners/default_object_spec.rb +687 -0
- data/spec/unit/operation_tree_flatteners/hash_spec.rb +632 -0
- data/spec/unit/operation_tree_flatteners/multiline_string_spec.rb +121 -0
- data/spec/unit/rspec/object_inspection_spec.rb +446 -0
- data/spec/unit/super_diff_spec.rb +1958 -0
- data/spec/unit/tiered_lines_elider_spec.rb +6356 -0
- data/spec/unit/tiered_lines_formatter_spec.rb +193 -0
- data/super_diff.gemspec +1 -1
- metadata +95 -50
- data/lib/super_diff/active_record/diff_formatters.rb +0 -10
- data/lib/super_diff/active_record/diff_formatters/active_record_relation.rb +0 -23
- data/lib/super_diff/active_record/object_inspection/inspectors.rb +0 -16
- data/lib/super_diff/active_support/diff_formatters.rb +0 -10
- data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +0 -36
- data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +0 -28
- data/lib/super_diff/diff_formatters.rb +0 -14
- data/lib/super_diff/diff_formatters/array.rb +0 -21
- data/lib/super_diff/diff_formatters/base.rb +0 -33
- data/lib/super_diff/diff_formatters/custom_object.rb +0 -30
- data/lib/super_diff/diff_formatters/default_object.rb +0 -46
- data/lib/super_diff/diff_formatters/defaults.rb +0 -10
- data/lib/super_diff/diff_formatters/hash.rb +0 -34
- data/lib/super_diff/diff_formatters/main.rb +0 -41
- data/lib/super_diff/object_inspection/inspectors.rb +0 -23
- data/lib/super_diff/object_inspection/inspectors/array.rb +0 -32
- data/lib/super_diff/object_inspection/inspectors/base.rb +0 -36
- data/lib/super_diff/object_inspection/inspectors/custom_object.rb +0 -37
- data/lib/super_diff/object_inspection/inspectors/default_object.rb +0 -61
- data/lib/super_diff/object_inspection/inspectors/hash.rb +0 -32
- data/lib/super_diff/object_inspection/inspectors/primitive.rb +0 -28
- data/lib/super_diff/object_inspection/inspectors/string.rb +0 -23
- data/lib/super_diff/object_inspection/inspectors/time_like.rb +0 -23
- data/lib/super_diff/object_inspection/nodes/break.rb +0 -15
- data/lib/super_diff/object_inspection/nodes/when_multiline.rb +0 -22
- data/lib/super_diff/object_inspection/nodes/when_singleline.rb +0 -24
- data/lib/super_diff/rspec/object_inspection/inspectors.rb +0 -40
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +0 -28
- data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +0 -31
- data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +0 -23
- data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +0 -23
- data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +0 -13
- data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +0 -29
- data/spec/support/object_id.rb +0 -27
- data/spec/support/ruby_versions.rb +0 -11
- data/spec/unit/object_inspection_spec.rb +0 -1168
@@ -1,14 +1,14 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integration do
|
4
|
-
context "when the actual
|
4
|
+
context "when the actual value is an object" do
|
5
5
|
context "with a small set of attributes" do
|
6
|
-
context "when all of the names are methods on the actual
|
6
|
+
context "when all of the names are methods on the actual object" do
|
7
7
|
it "produces the correct output when used in the positive" do
|
8
8
|
as_both_colored_and_uncolored do |color_enabled|
|
9
9
|
snippet = <<~TEST.strip
|
10
10
|
expected = { name: "b" }
|
11
|
-
actual
|
11
|
+
actual = SuperDiff::Test::Person.new(name: "a", age: 9)
|
12
12
|
expect(actual).to have_attributes(expected)
|
13
13
|
TEST
|
14
14
|
program = make_plain_test_program(
|
@@ -21,20 +21,20 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
21
21
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
22
22
|
expectation: proc {
|
23
23
|
line do
|
24
|
-
plain
|
25
|
-
|
26
|
-
plain
|
27
|
-
|
28
|
-
plain
|
24
|
+
plain %|Expected |
|
25
|
+
actual %|#<SuperDiff::Test::Person name: "a", age: 9>|
|
26
|
+
plain %| to have attributes |
|
27
|
+
expected %|(name: "b")|
|
28
|
+
plain %|.|
|
29
29
|
end
|
30
30
|
},
|
31
31
|
diff: proc {
|
32
|
-
plain_line
|
33
|
-
#
|
34
|
-
|
35
|
-
|
36
|
-
plain_line
|
37
|
-
plain_line
|
32
|
+
plain_line %| #<SuperDiff::Test::Person {|
|
33
|
+
# expected_line %|- name: "b",| # FIXME
|
34
|
+
expected_line %|- name: "b"|
|
35
|
+
actual_line %|+ name: "a",|
|
36
|
+
plain_line %| age: 9|
|
37
|
+
plain_line %| }>|
|
38
38
|
},
|
39
39
|
)
|
40
40
|
|
@@ -48,7 +48,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
48
48
|
as_both_colored_and_uncolored do |color_enabled|
|
49
49
|
snippet = <<~TEST.strip
|
50
50
|
expected = { name: "a" }
|
51
|
-
actual
|
51
|
+
actual = SuperDiff::Test::Person.new(name: "a", age: 9)
|
52
52
|
expect(actual).not_to have_attributes(expected)
|
53
53
|
TEST
|
54
54
|
program = make_plain_test_program(
|
@@ -61,11 +61,11 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
61
61
|
snippet: %|expect(actual).not_to have_attributes(expected)|,
|
62
62
|
expectation: proc {
|
63
63
|
line do
|
64
|
-
plain
|
65
|
-
|
66
|
-
plain
|
67
|
-
|
68
|
-
plain
|
64
|
+
plain %|Expected |
|
65
|
+
actual %|#<SuperDiff::Test::Person name: "a", age: 9>|
|
66
|
+
plain %| not to have attributes |
|
67
|
+
expected %|(name: "a")|
|
68
|
+
plain %|.|
|
69
69
|
end
|
70
70
|
},
|
71
71
|
)
|
@@ -77,12 +77,12 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
context "when some of the names are not methods on the actual
|
80
|
+
context "when some of the names are not methods on the actual object" do
|
81
81
|
it "produces the correct output" do
|
82
82
|
as_both_colored_and_uncolored do |color_enabled|
|
83
83
|
snippet = <<~TEST.strip
|
84
84
|
expected = { name: "b", foo: "bar" }
|
85
|
-
actual
|
85
|
+
actual = SuperDiff::Test::Person.new(name: "a", age: 9)
|
86
86
|
expect(actual).to have_attributes(expected)
|
87
87
|
TEST
|
88
88
|
program = make_plain_test_program(
|
@@ -95,23 +95,23 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
95
95
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
96
96
|
expectation: proc {
|
97
97
|
line do
|
98
|
-
plain
|
99
|
-
|
100
|
-
plain
|
101
|
-
|
102
|
-
plain
|
103
|
-
|
104
|
-
plain
|
98
|
+
plain %|Expected |
|
99
|
+
actual %|#<SuperDiff::Test::Person name: "a", age: 9>|
|
100
|
+
plain %| to respond to |
|
101
|
+
expected %|:foo|
|
102
|
+
plain %| with |
|
103
|
+
expected %|0|
|
104
|
+
plain %| arguments.|
|
105
105
|
end
|
106
106
|
},
|
107
107
|
diff: proc {
|
108
|
-
plain_line
|
109
|
-
plain_line
|
110
|
-
# plain_line
|
111
|
-
plain_line
|
112
|
-
#
|
113
|
-
|
114
|
-
plain_line
|
108
|
+
plain_line %| #<SuperDiff::Test::Person {|
|
109
|
+
plain_line %| name: "a",|
|
110
|
+
# plain_line %| age: 9,| # FIXME
|
111
|
+
plain_line %| age: 9|
|
112
|
+
# expected_line %|- foo: "bar"| # FIXME
|
113
|
+
expected_line %|- foo: "bar",|
|
114
|
+
plain_line %| }>|
|
115
115
|
},
|
116
116
|
)
|
117
117
|
|
@@ -124,7 +124,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
124
124
|
end
|
125
125
|
|
126
126
|
context "with a large set of attributes" do
|
127
|
-
context "when all of the names are methods on the actual
|
127
|
+
context "when all of the names are methods on the actual object" do
|
128
128
|
it "produces the correct output when used in the positive" do
|
129
129
|
as_both_colored_and_uncolored do |color_enabled|
|
130
130
|
snippet = <<~TEST.strip
|
@@ -134,7 +134,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
134
134
|
state: "CA",
|
135
135
|
zip: "91234"
|
136
136
|
}
|
137
|
-
actual
|
137
|
+
actual = SuperDiff::Test::ShippingAddress.new(
|
138
138
|
line_1: "456 Ponderosa Ct.",
|
139
139
|
line_2: nil,
|
140
140
|
city: "Hill Valley",
|
@@ -153,27 +153,26 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
153
153
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
154
154
|
expectation: proc {
|
155
155
|
line do
|
156
|
-
plain
|
157
|
-
|
156
|
+
plain %| Expected |
|
157
|
+
actual %|#<SuperDiff::Test::ShippingAddress line_1: "456 Ponderosa Ct.", line_2: nil, city: "Hill Valley", state: "CA", zip: "90382">|
|
158
158
|
end
|
159
159
|
|
160
160
|
line do
|
161
|
-
plain
|
162
|
-
|
161
|
+
plain %|to have attributes |
|
162
|
+
expected %|(line_1: "123 Main St.", city: "Oakland", state: "CA", zip: "91234")|
|
163
163
|
end
|
164
164
|
},
|
165
165
|
diff: proc {
|
166
|
-
plain_line
|
167
|
-
|
168
|
-
|
169
|
-
plain_line
|
170
|
-
|
171
|
-
|
172
|
-
plain_line
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
plain_line %| }>|
|
166
|
+
plain_line %| #<SuperDiff::Test::ShippingAddress {|
|
167
|
+
expected_line %|- line_1: "123 Main St.",|
|
168
|
+
actual_line %|+ line_1: "456 Ponderosa Ct.",|
|
169
|
+
plain_line %| line_2: nil,|
|
170
|
+
expected_line %|- city: "Oakland",|
|
171
|
+
actual_line %|+ city: "Hill Valley",|
|
172
|
+
plain_line %| state: "CA",|
|
173
|
+
expected_line %|- zip: "91234",| # FIXME
|
174
|
+
actual_line %|+ zip: "90382"|
|
175
|
+
plain_line %| }>|
|
177
176
|
},
|
178
177
|
)
|
179
178
|
|
@@ -192,7 +191,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
192
191
|
state: "CA",
|
193
192
|
zip: "91234"
|
194
193
|
}
|
195
|
-
actual
|
194
|
+
actual = SuperDiff::Test::ShippingAddress.new(
|
196
195
|
line_1: "123 Main St.",
|
197
196
|
line_2: nil,
|
198
197
|
city: "Oakland",
|
@@ -212,13 +211,13 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
212
211
|
newline_before_expectation: true,
|
213
212
|
expectation: proc {
|
214
213
|
line do
|
215
|
-
plain
|
216
|
-
|
214
|
+
plain %| Expected |
|
215
|
+
actual %|#<SuperDiff::Test::ShippingAddress line_1: "123 Main St.", line_2: nil, city: "Oakland", state: "CA", zip: "91234">|
|
217
216
|
end
|
218
217
|
|
219
218
|
line do
|
220
|
-
plain
|
221
|
-
|
219
|
+
plain %|not to have attributes |
|
220
|
+
expected %|(line_1: "123 Main St.", city: "Oakland", state: "CA", zip: "91234")|
|
222
221
|
end
|
223
222
|
},
|
224
223
|
)
|
@@ -230,7 +229,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
230
229
|
end
|
231
230
|
end
|
232
231
|
|
233
|
-
context "when some of the names are not methods on the actual
|
232
|
+
context "when some of the names are not methods on the actual object" do
|
234
233
|
it "produces the correct output" do
|
235
234
|
as_both_colored_and_uncolored do |color_enabled|
|
236
235
|
snippet = <<~TEST.strip
|
@@ -242,7 +241,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
242
241
|
foo: "bar",
|
243
242
|
baz: "qux"
|
244
243
|
}
|
245
|
-
actual
|
244
|
+
actual = SuperDiff::Test::ShippingAddress.new(
|
246
245
|
line_1: "456 Ponderosa Ct.",
|
247
246
|
line_2: nil,
|
248
247
|
city: "Hill Valley",
|
@@ -261,32 +260,32 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
261
260
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
262
261
|
expectation: proc {
|
263
262
|
line do
|
264
|
-
plain
|
265
|
-
|
263
|
+
plain %| Expected |
|
264
|
+
actual %|#<SuperDiff::Test::ShippingAddress line_1: "456 Ponderosa Ct.", line_2: nil, city: "Hill Valley", state: "CA", zip: "90382">|
|
266
265
|
end
|
267
266
|
|
268
267
|
line do
|
269
|
-
plain
|
270
|
-
|
271
|
-
plain
|
272
|
-
|
273
|
-
plain
|
274
|
-
|
275
|
-
plain
|
268
|
+
plain %|to respond to |
|
269
|
+
expected %|:foo|
|
270
|
+
plain %| and |
|
271
|
+
expected %|:baz|
|
272
|
+
plain %| with |
|
273
|
+
expected %|0|
|
274
|
+
plain %| arguments|
|
276
275
|
end
|
277
276
|
},
|
278
277
|
diff: proc {
|
279
|
-
plain_line
|
280
|
-
plain_line
|
281
|
-
plain_line
|
282
|
-
plain_line
|
283
|
-
plain_line
|
284
|
-
# plain_line
|
285
|
-
plain_line
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
plain_line
|
278
|
+
plain_line %| #<SuperDiff::Test::ShippingAddress {|
|
279
|
+
plain_line %| line_1: "456 Ponderosa Ct.",|
|
280
|
+
plain_line %| line_2: nil,|
|
281
|
+
plain_line %| city: "Hill Valley",|
|
282
|
+
plain_line %| state: "CA",|
|
283
|
+
# plain_line %| zip: "90382",| # FIXME
|
284
|
+
plain_line %| zip: "90382"|
|
285
|
+
expected_line %|- foo: "bar",|
|
286
|
+
# expected_line %|- baz: "qux"| # TODO
|
287
|
+
expected_line %|- baz: "qux",|
|
288
|
+
plain_line %| }>|
|
290
289
|
},
|
291
290
|
)
|
292
291
|
|
@@ -299,12 +298,12 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
299
298
|
end
|
300
299
|
end
|
301
300
|
|
302
|
-
context "when the actual
|
301
|
+
context "when the actual value is actually a hash instead of an object" do
|
303
302
|
it "displays the diff as if we were comparing hashes" do
|
304
303
|
as_both_colored_and_uncolored do |color_enabled|
|
305
304
|
snippet = <<~TEST.strip
|
306
305
|
expected = { name: "Elliot", age: 32 }
|
307
|
-
actual
|
306
|
+
actual = {}
|
308
307
|
expect(actual).to have_attributes(expected)
|
309
308
|
TEST
|
310
309
|
|
@@ -315,22 +314,22 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
315
314
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
316
315
|
expectation: proc {
|
317
316
|
line do
|
318
|
-
plain
|
319
|
-
|
320
|
-
plain
|
321
|
-
|
322
|
-
plain
|
323
|
-
|
324
|
-
plain
|
325
|
-
|
326
|
-
plain
|
317
|
+
plain %|Expected |
|
318
|
+
actual %|{}|
|
319
|
+
plain %| to respond to |
|
320
|
+
expected %|:name|
|
321
|
+
plain %| and |
|
322
|
+
expected %|:age|
|
323
|
+
plain %| with |
|
324
|
+
expected %|0|
|
325
|
+
plain %| arguments.|
|
327
326
|
end
|
328
327
|
},
|
329
328
|
diff: proc {
|
330
|
-
plain_line
|
331
|
-
|
332
|
-
|
333
|
-
plain_line
|
329
|
+
plain_line %| {|
|
330
|
+
expected_line %|- name: "Elliot",|
|
331
|
+
expected_line %|- age: 32|
|
332
|
+
plain_line %| }|
|
334
333
|
},
|
335
334
|
)
|
336
335
|
|
@@ -359,7 +358,7 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
359
358
|
created_at: a_value_within(1).of(Time.utc(2020, 4, 9))
|
360
359
|
}
|
361
360
|
|
362
|
-
actual
|
361
|
+
actual = {}
|
363
362
|
|
364
363
|
expect(actual).to have_attributes(expected)
|
365
364
|
TEST
|
@@ -374,45 +373,55 @@ RSpec.describe "Integration with RSpec's #have_attributes matcher", type: :integ
|
|
374
373
|
snippet: %|expect(actual).to have_attributes(expected)|,
|
375
374
|
expectation: proc {
|
376
375
|
line do
|
377
|
-
plain
|
378
|
-
|
376
|
+
plain %| Expected |
|
377
|
+
actual %|{}|
|
379
378
|
end
|
380
379
|
|
381
380
|
line do
|
382
|
-
plain
|
383
|
-
|
384
|
-
plain
|
385
|
-
|
386
|
-
plain
|
387
|
-
|
388
|
-
plain
|
389
|
-
|
390
|
-
plain
|
391
|
-
|
392
|
-
plain
|
393
|
-
|
394
|
-
plain
|
381
|
+
plain %|to respond to |
|
382
|
+
expected %|:name|
|
383
|
+
plain %|, |
|
384
|
+
expected %|:shipping_address|
|
385
|
+
plain %|, |
|
386
|
+
expected %|:order_ids|
|
387
|
+
plain %|, |
|
388
|
+
expected %|:data|
|
389
|
+
plain %| and |
|
390
|
+
expected %|:created_at|
|
391
|
+
plain %| with |
|
392
|
+
expected %|0|
|
393
|
+
plain %| arguments|
|
395
394
|
end
|
396
395
|
},
|
397
396
|
diff: proc {
|
398
|
-
plain_line
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
397
|
+
plain_line %| {|
|
398
|
+
expected_line %|- name: "Elliot",|
|
399
|
+
expected_line %|- shipping_address: #<an object having attributes (|
|
400
|
+
expected_line %|- line_1: #<a kind of String>,|
|
401
|
+
expected_line %|- line_2: nil,|
|
402
|
+
expected_line %|- city: #<an instance of String>,|
|
403
|
+
expected_line %|- state: "CA",|
|
404
|
+
expected_line %|- zip: "91234"|
|
405
|
+
expected_line %|- )>,|
|
406
|
+
expected_line %|- order_ids: #<a collection including (|
|
407
|
+
expected_line %|- 1,|
|
408
|
+
expected_line %|- 2|
|
409
|
+
expected_line %|- )>,|
|
410
|
+
expected_line %|- data: #<a hash including (|
|
411
|
+
expected_line %|- active: true|
|
412
|
+
expected_line %|- )>,|
|
413
|
+
expected_line %|- created_at: #<a value within 1 of #<Time {|
|
414
|
+
expected_line %|- year: 2020,|
|
415
|
+
expected_line %|- month: 4,|
|
416
|
+
expected_line %|- day: 9,|
|
417
|
+
expected_line %|- hour: 0,|
|
418
|
+
expected_line %|- min: 0,|
|
419
|
+
expected_line %|- sec: 0,|
|
420
|
+
expected_line %|- subsec: 0,|
|
421
|
+
expected_line %|- zone: "UTC",|
|
422
|
+
expected_line %|- utc_offset: 0|
|
423
|
+
expected_line %|- }>>|
|
424
|
+
plain_line %| }|
|
416
425
|
},
|
417
426
|
)
|
418
427
|
|
@@ -16,11 +16,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
16
16
|
snippet: snippet,
|
17
17
|
expectation: proc {
|
18
18
|
line do
|
19
|
-
plain
|
20
|
-
|
21
|
-
plain
|
22
|
-
|
23
|
-
plain
|
19
|
+
plain %|Expected |
|
20
|
+
actual %|:words|
|
21
|
+
plain %| to respond to |
|
22
|
+
expected %|has_power?|
|
23
|
+
plain %|.|
|
24
24
|
end
|
25
25
|
},
|
26
26
|
)
|
@@ -32,7 +32,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
context "when the inspected version of the actual
|
35
|
+
context "when the inspected version of the actual value is long" do
|
36
36
|
it "produces the correct failure message" do
|
37
37
|
as_both_colored_and_uncolored do |color_enabled|
|
38
38
|
snippet = <<~TEST.strip
|
@@ -50,13 +50,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
50
50
|
newline_before_expectation: true,
|
51
51
|
expectation: proc {
|
52
52
|
line do
|
53
|
-
plain
|
54
|
-
|
53
|
+
plain %| Expected |
|
54
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
55
55
|
end
|
56
56
|
|
57
57
|
line do
|
58
|
-
plain
|
59
|
-
|
58
|
+
plain %|to respond to |
|
59
|
+
expected %|has_mapping?|
|
60
60
|
end
|
61
61
|
},
|
62
62
|
)
|
@@ -71,7 +71,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
71
71
|
|
72
72
|
context "when the predicate method exists on the object" do
|
73
73
|
context "but is private" do
|
74
|
-
context "when the inspected version of the actual
|
74
|
+
context "when the inspected version of the actual value is short" do
|
75
75
|
it "produces the correct failure message" do
|
76
76
|
as_both_colored_and_uncolored do |color_enabled|
|
77
77
|
snippet = <<~TEST.strip
|
@@ -91,11 +91,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
91
91
|
snippet: %|expect(Robot.new).to have_arms|,
|
92
92
|
expectation: proc {
|
93
93
|
line do
|
94
|
-
plain
|
95
|
-
|
96
|
-
plain
|
97
|
-
|
98
|
-
plain
|
94
|
+
plain %|Expected |
|
95
|
+
actual %|#<Robot>|
|
96
|
+
plain %| to have a public method |
|
97
|
+
expected %|has_arms?|
|
98
|
+
plain %|.|
|
99
99
|
end
|
100
100
|
},
|
101
101
|
)
|
@@ -108,7 +108,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
context "when the inspected version of the actual
|
111
|
+
context "when the inspected version of the actual value is long" do
|
112
112
|
it "produces the correct failure message" do
|
113
113
|
as_both_colored_and_uncolored do |color_enabled|
|
114
114
|
snippet = <<~TEST.strip
|
@@ -131,13 +131,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
131
131
|
newline_before_expectation: true,
|
132
132
|
expectation: proc {
|
133
133
|
line do
|
134
|
-
plain
|
135
|
-
|
134
|
+
plain %| Expected |
|
135
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
136
136
|
end
|
137
137
|
|
138
138
|
line do
|
139
|
-
plain
|
140
|
-
|
139
|
+
plain %|to have a public method |
|
140
|
+
expected %|has_mapping?|
|
141
141
|
end
|
142
142
|
},
|
143
143
|
)
|
@@ -154,7 +154,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
154
154
|
context "and is public" do
|
155
155
|
context "and returns false" do
|
156
156
|
context "and takes arguments" do
|
157
|
-
context "when the inspected version of the actual
|
157
|
+
context "when the inspected version of the actual value is short" do
|
158
158
|
it "produces the correct failure message" do
|
159
159
|
as_both_colored_and_uncolored do |color_enabled|
|
160
160
|
snippet = <<~TEST.strip
|
@@ -174,11 +174,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
174
174
|
snippet: %|expect(Drink.new).to have_ingredients(:vodka)|,
|
175
175
|
expectation: proc {
|
176
176
|
line do
|
177
|
-
plain
|
178
|
-
|
179
|
-
plain
|
180
|
-
|
181
|
-
plain
|
177
|
+
plain %|Expected |
|
178
|
+
actual %|#<Drink>|
|
179
|
+
plain %| to return a truthy result for |
|
180
|
+
expected %|has_ingredients?(:vodka)|
|
181
|
+
plain %|.|
|
182
182
|
end
|
183
183
|
},
|
184
184
|
)
|
@@ -191,7 +191,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
context "when the inspected version of the actual
|
194
|
+
context "when the inspected version of the actual value is long" do
|
195
195
|
it "produces the correct failure message" do
|
196
196
|
as_both_colored_and_uncolored do |color_enabled|
|
197
197
|
snippet = <<~TEST.strip
|
@@ -214,13 +214,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
214
214
|
newline_before_expectation: true,
|
215
215
|
expectation: proc {
|
216
216
|
line do
|
217
|
-
plain
|
218
|
-
|
217
|
+
plain %| Expected |
|
218
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
219
219
|
end
|
220
220
|
|
221
221
|
line do
|
222
|
-
plain
|
223
|
-
|
222
|
+
plain %|to return a truthy result for |
|
223
|
+
expected %|has_contents?("keys", "upon", "keys")|
|
224
224
|
end
|
225
225
|
},
|
226
226
|
)
|
@@ -235,7 +235,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
235
235
|
end
|
236
236
|
|
237
237
|
context "and takes no arguments" do
|
238
|
-
context "when the inspected version of the actual
|
238
|
+
context "when the inspected version of the actual value is short" do
|
239
239
|
it "produces the correct failure message" do
|
240
240
|
as_both_colored_and_uncolored do |color_enabled|
|
241
241
|
snippet = <<~TEST.strip
|
@@ -255,11 +255,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
255
255
|
snippet: %|expect(Robot.new).to have_arms|,
|
256
256
|
expectation: proc {
|
257
257
|
line do
|
258
|
-
plain
|
259
|
-
|
260
|
-
plain
|
261
|
-
|
262
|
-
plain
|
258
|
+
plain %|Expected |
|
259
|
+
actual %|#<Robot>|
|
260
|
+
plain %| to return a truthy result for |
|
261
|
+
expected %|has_arms?|
|
262
|
+
plain %|.|
|
263
263
|
end
|
264
264
|
},
|
265
265
|
)
|
@@ -272,7 +272,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
275
|
-
context "when the inspected version of the actual
|
275
|
+
context "when the inspected version of the actual value is long" do
|
276
276
|
it "produces the correct failure message" do
|
277
277
|
as_both_colored_and_uncolored do |color_enabled|
|
278
278
|
snippet = <<~TEST.strip
|
@@ -295,13 +295,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
295
295
|
newline_before_expectation: true,
|
296
296
|
expectation: proc {
|
297
297
|
line do
|
298
|
-
plain
|
299
|
-
|
298
|
+
plain %| Expected |
|
299
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
300
300
|
end
|
301
301
|
|
302
302
|
line do
|
303
|
-
plain
|
304
|
-
|
303
|
+
plain %|to return a truthy result for |
|
304
|
+
expected %|has_mapping?|
|
305
305
|
end
|
306
306
|
},
|
307
307
|
)
|
@@ -318,7 +318,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
318
318
|
|
319
319
|
context "and returns true" do
|
320
320
|
context "and takes arguments" do
|
321
|
-
context "when the inspected version of the actual
|
321
|
+
context "when the inspected version of the actual value is short" do
|
322
322
|
it "produces the correct failure message" do
|
323
323
|
as_both_colored_and_uncolored do |color_enabled|
|
324
324
|
snippet = <<~TEST.strip
|
@@ -338,11 +338,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
338
338
|
snippet: %|expect(Drink.new).not_to have_ingredients(:vodka)|,
|
339
339
|
expectation: proc {
|
340
340
|
line do
|
341
|
-
plain
|
342
|
-
|
343
|
-
plain
|
344
|
-
|
345
|
-
plain
|
341
|
+
plain %|Expected |
|
342
|
+
actual %|#<Drink>|
|
343
|
+
plain %| not to return a truthy result for |
|
344
|
+
expected %|has_ingredients?(:vodka)|
|
345
|
+
plain %|.|
|
346
346
|
end
|
347
347
|
},
|
348
348
|
)
|
@@ -355,7 +355,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
358
|
-
context "when the inspected version of the actual
|
358
|
+
context "when the inspected version of the actual value is long" do
|
359
359
|
it "produces the correct failure message" do
|
360
360
|
as_both_colored_and_uncolored do |color_enabled|
|
361
361
|
snippet = <<~TEST.strip
|
@@ -378,13 +378,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
378
378
|
newline_before_expectation: true,
|
379
379
|
expectation: proc {
|
380
380
|
line do
|
381
|
-
plain
|
382
|
-
|
381
|
+
plain %| Expected |
|
382
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
383
383
|
end
|
384
384
|
|
385
385
|
line do
|
386
|
-
plain
|
387
|
-
|
386
|
+
plain %|not to return a truthy result for |
|
387
|
+
expected %|has_contents?("keys", "upon", "keys")|
|
388
388
|
end
|
389
389
|
},
|
390
390
|
)
|
@@ -399,7 +399,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
399
399
|
end
|
400
400
|
|
401
401
|
context "and takes no arguments" do
|
402
|
-
context "when the inspected version of the actual
|
402
|
+
context "when the inspected version of the actual value is short" do
|
403
403
|
it "produces the correct failure message when used in the negative" do
|
404
404
|
as_both_colored_and_uncolored do |color_enabled|
|
405
405
|
snippet = <<~TEST.strip
|
@@ -419,11 +419,11 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
419
419
|
snippet: %|expect(Robot.new).not_to have_arms|,
|
420
420
|
expectation: proc {
|
421
421
|
line do
|
422
|
-
plain
|
423
|
-
|
424
|
-
plain
|
425
|
-
|
426
|
-
plain
|
422
|
+
plain %|Expected |
|
423
|
+
actual %|#<Robot>|
|
424
|
+
plain %| not to return a truthy result for |
|
425
|
+
expected %|has_arms?|
|
426
|
+
plain %|.|
|
427
427
|
end
|
428
428
|
},
|
429
429
|
)
|
@@ -436,7 +436,7 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
436
436
|
end
|
437
437
|
end
|
438
438
|
|
439
|
-
context "when the inspected version of the actual
|
439
|
+
context "when the inspected version of the actual value is long" do
|
440
440
|
it "produces the correct failure message when used in the negative" do
|
441
441
|
as_both_colored_and_uncolored do |color_enabled|
|
442
442
|
snippet = <<~TEST.strip
|
@@ -459,13 +459,13 @@ RSpec.describe "Integration with RSpec's #have_<predicate> matcher", type: :inte
|
|
459
459
|
newline_before_expectation: true,
|
460
460
|
expectation: proc {
|
461
461
|
line do
|
462
|
-
plain
|
463
|
-
|
462
|
+
plain %| Expected |
|
463
|
+
actual %|{ a: "lot", of: "keys", and: "things", like: "that", lets: "add", more: "keys" }|
|
464
464
|
end
|
465
465
|
|
466
466
|
line do
|
467
|
-
plain
|
468
|
-
|
467
|
+
plain %|not to return a truthy result for |
|
468
|
+
expected %|has_mapping?|
|
469
469
|
end
|
470
470
|
},
|
471
471
|
)
|