super_diff 0.2.0 → 0.5.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 +108 -74
- data/lib/super_diff.rb +20 -11
- data/lib/super_diff/active_record.rb +21 -23
- data/lib/super_diff/active_record/diff_formatters/active_record_relation.rb +3 -3
- data/lib/super_diff/active_record/differs/active_record_relation.rb +3 -5
- data/lib/super_diff/active_record/monkey_patches.rb +9 -0
- data/lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb +32 -22
- data/lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb +17 -7
- data/lib/super_diff/active_record/operation_tree_builders.rb +14 -0
- data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_model.rb +2 -2
- data/lib/super_diff/active_record/{operational_sequencers → operation_tree_builders}/active_record_relation.rb +4 -4
- data/lib/super_diff/active_record/{operation_sequences.rb → operation_trees.rb} +2 -2
- data/lib/super_diff/active_record/{operation_sequences → operation_trees}/active_record_relation.rb +2 -2
- data/lib/super_diff/active_support.rb +16 -19
- data/lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb +3 -3
- data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +3 -5
- data/lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb +17 -7
- data/lib/super_diff/active_support/operation_tree_builders.rb +10 -0
- data/lib/super_diff/active_support/{operational_sequencers → operation_tree_builders}/hash_with_indifferent_access.rb +2 -2
- data/lib/super_diff/active_support/{operation_sequences.rb → operation_trees.rb} +2 -2
- data/lib/super_diff/active_support/{operation_sequences → operation_trees}/hash_with_indifferent_access.rb +2 -2
- data/lib/super_diff/configuration.rb +60 -0
- data/lib/super_diff/csi.rb +4 -0
- data/lib/super_diff/diff_formatters.rb +3 -3
- data/lib/super_diff/diff_formatters/array.rb +3 -3
- data/lib/super_diff/diff_formatters/base.rb +3 -2
- data/lib/super_diff/diff_formatters/collection.rb +2 -2
- data/lib/super_diff/diff_formatters/custom_object.rb +3 -3
- data/lib/super_diff/diff_formatters/default_object.rb +6 -8
- data/lib/super_diff/diff_formatters/defaults.rb +10 -0
- data/lib/super_diff/diff_formatters/hash.rb +3 -3
- data/lib/super_diff/diff_formatters/main.rb +41 -0
- data/lib/super_diff/diff_formatters/multiline_string.rb +3 -3
- data/lib/super_diff/differs.rb +4 -9
- data/lib/super_diff/differs/array.rb +2 -11
- data/lib/super_diff/differs/base.rb +20 -3
- data/lib/super_diff/differs/custom_object.rb +2 -11
- data/lib/super_diff/differs/default_object.rb +2 -8
- data/lib/super_diff/differs/defaults.rb +12 -0
- data/lib/super_diff/differs/hash.rb +2 -11
- data/lib/super_diff/differs/main.rb +48 -0
- data/lib/super_diff/differs/multiline_string.rb +2 -14
- data/lib/super_diff/differs/time_like.rb +15 -0
- data/lib/super_diff/equality_matchers.rb +3 -9
- data/lib/super_diff/equality_matchers/array.rb +1 -7
- data/lib/super_diff/equality_matchers/base.rb +1 -1
- data/lib/super_diff/equality_matchers/default.rb +2 -8
- data/lib/super_diff/equality_matchers/defaults.rb +12 -0
- data/lib/super_diff/equality_matchers/hash.rb +1 -7
- data/lib/super_diff/equality_matchers/main.rb +21 -0
- data/lib/super_diff/equality_matchers/multiline_string.rb +1 -7
- data/lib/super_diff/errors.rb +16 -0
- data/lib/super_diff/errors/no_diff_formatter_available_error.rb +21 -0
- data/lib/super_diff/errors/no_differ_available_error.rb +24 -0
- data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +22 -0
- data/lib/super_diff/implementation_checks.rb +19 -0
- data/lib/super_diff/object_inspection.rb +1 -10
- data/lib/super_diff/object_inspection/inspection_tree.rb +6 -2
- data/lib/super_diff/object_inspection/inspectors.rb +5 -0
- data/lib/super_diff/object_inspection/inspectors/array.rb +20 -10
- data/lib/super_diff/object_inspection/inspectors/base.rb +36 -0
- data/lib/super_diff/object_inspection/inspectors/custom_object.rb +24 -14
- data/lib/super_diff/object_inspection/inspectors/default_object.rb +44 -30
- data/lib/super_diff/object_inspection/inspectors/defaults.rb +15 -0
- data/lib/super_diff/object_inspection/inspectors/hash.rb +20 -10
- data/lib/super_diff/object_inspection/inspectors/main.rb +35 -0
- data/lib/super_diff/object_inspection/inspectors/primitive.rb +20 -5
- data/lib/super_diff/object_inspection/inspectors/string.rb +15 -5
- data/lib/super_diff/object_inspection/inspectors/time_like.rb +23 -0
- data/lib/super_diff/object_inspection/nodes/inspection.rb +9 -2
- data/lib/super_diff/operation_tree_builders.rb +18 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/array.rb +38 -59
- data/lib/super_diff/operation_tree_builders/base.rb +98 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/custom_object.rb +3 -3
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/default_object.rb +8 -3
- data/lib/super_diff/operation_tree_builders/defaults.rb +5 -0
- data/lib/super_diff/operation_tree_builders/hash.rb +226 -0
- data/lib/super_diff/operation_tree_builders/main.rb +42 -0
- data/lib/super_diff/{operational_sequencers → operation_tree_builders}/multiline_string.rb +3 -3
- data/lib/super_diff/operation_tree_builders/time_like.rb +34 -0
- data/lib/super_diff/operation_trees.rb +13 -0
- data/lib/super_diff/{operation_sequences → operation_trees}/array.rb +5 -1
- data/lib/super_diff/operation_trees/base.rb +31 -0
- data/lib/super_diff/{operation_sequences → operation_trees}/custom_object.rb +5 -1
- data/lib/super_diff/{operation_sequences → operation_trees}/default_object.rb +10 -8
- data/lib/super_diff/operation_trees/defaults.rb +5 -0
- data/lib/super_diff/{operation_sequences → operation_trees}/hash.rb +5 -1
- data/lib/super_diff/operation_trees/main.rb +35 -0
- data/lib/super_diff/operation_trees/multiline_string.rb +18 -0
- data/lib/super_diff/operations/unary_operation.rb +3 -0
- data/lib/super_diff/rspec.rb +54 -22
- data/lib/super_diff/rspec/augmented_matcher.rb +1 -1
- data/lib/super_diff/rspec/differ.rb +2 -17
- data/lib/super_diff/rspec/differs.rb +9 -3
- data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +3 -8
- data/lib/super_diff/rspec/differs/collection_including.rb +18 -0
- data/lib/super_diff/rspec/differs/hash_including.rb +18 -0
- data/lib/super_diff/rspec/differs/object_having_attributes.rb +17 -0
- data/lib/super_diff/rspec/matcher_text_builders.rb +4 -0
- data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +26 -7
- data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +61 -0
- data/lib/super_diff/rspec/matcher_text_builders/match.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +13 -1
- data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +1 -1
- data/lib/super_diff/rspec/matcher_text_template.rb +1 -1
- data/lib/super_diff/rspec/monkey_patches.rb +226 -115
- data/lib/super_diff/rspec/object_inspection.rb +0 -1
- data/lib/super_diff/rspec/object_inspection/inspectors.rb +22 -6
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb +17 -8
- data/lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb +28 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb +31 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb +23 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb +23 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb +31 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/primitive.rb +13 -0
- data/lib/super_diff/rspec/object_inspection/inspectors/value_within.rb +29 -0
- data/lib/super_diff/rspec/operation_tree_builders.rb +22 -0
- data/lib/super_diff/rspec/{operational_sequencers → operation_tree_builders}/collection_containing_exactly.rb +6 -6
- data/lib/super_diff/rspec/{operational_sequencers/partial_array.rb → operation_tree_builders/collection_including.rb} +4 -3
- data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +25 -0
- data/lib/super_diff/rspec/{operational_sequencers/partial_object.rb → operation_tree_builders/object_having_attributes.rb} +5 -11
- data/lib/super_diff/version.rb +1 -1
- data/spec/examples.txt +397 -328
- data/spec/integration/rails/active_record_spec.rb +1 -1
- data/spec/integration/rails/hash_with_indifferent_access_spec.rb +1 -1
- data/spec/integration/rspec/be_predicate_matcher_spec.rb +111 -59
- data/spec/integration/rspec/eq_matcher_spec.rb +139 -3
- data/spec/integration/rspec/have_attributes_matcher_spec.rb +354 -227
- data/spec/integration/rspec/have_predicate_matcher_spec.rb +484 -0
- data/spec/integration/rspec/include_matcher_spec.rb +2 -2
- data/spec/integration/rspec/match_array_matcher_spec.rb +372 -0
- data/spec/integration/rspec/match_matcher_spec.rb +8 -8
- data/spec/integration/rspec/raise_error_matcher_spec.rb +605 -226
- data/spec/integration/rspec/third_party_matcher_spec.rb +241 -0
- data/spec/integration/rspec/unhandled_errors_spec.rb +110 -58
- data/spec/spec_helper.rb +18 -7
- data/spec/support/command_runner.rb +3 -0
- data/spec/support/integration/helpers.rb +14 -90
- data/spec/support/integration/matchers.rb +143 -0
- data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +14 -29
- data/spec/support/integration/test_programs/base.rb +120 -0
- data/spec/support/integration/test_programs/plain.rb +13 -0
- data/spec/support/integration/test_programs/rspec_active_record.rb +17 -0
- data/spec/support/integration/test_programs/rspec_rails.rb +17 -0
- data/spec/support/models/active_record/person.rb +4 -11
- data/spec/support/models/active_record/query.rb +15 -0
- data/spec/support/models/active_record/shipping_address.rb +10 -14
- data/spec/support/object_id.rb +27 -0
- data/spec/support/ruby_versions.rb +4 -0
- data/spec/support/shared_examples/active_record.rb +71 -0
- data/spec/support/shared_examples/hash_with_indifferent_access.rb +724 -208
- data/spec/tmp/integration_spec.rb +15 -0
- data/spec/unit/{equality_matcher_spec.rb → equality_matchers/main_spec.rb} +165 -9
- data/spec/unit/object_inspection_spec.rb +94 -18
- data/spec/unit/rspec/matchers/have_predicate_spec.rb +21 -0
- data/spec/unit/rspec/matchers/match_array_spec.rb +11 -0
- data/spec/unit/rspec/matchers/raise_error_spec.rb +16 -0
- data/super_diff.gemspec +3 -6
- metadata +99 -91
- data/lib/super_diff/active_record/object_inspection/map_extension.rb +0 -18
- data/lib/super_diff/active_record/operational_sequencers.rb +0 -14
- data/lib/super_diff/active_support/object_inspection/map_extension.rb +0 -15
- data/lib/super_diff/active_support/operational_sequencers.rb +0 -10
- data/lib/super_diff/diff_formatter.rb +0 -32
- data/lib/super_diff/differ.rb +0 -51
- data/lib/super_diff/equality_matcher.rb +0 -32
- data/lib/super_diff/no_differ_available_error.rb +0 -22
- data/lib/super_diff/no_operational_sequencer_available_error.rb +0 -20
- data/lib/super_diff/object_inspection/inspector.rb +0 -27
- data/lib/super_diff/object_inspection/map.rb +0 -28
- data/lib/super_diff/operation_sequences.rb +0 -9
- data/lib/super_diff/operation_sequences/base.rb +0 -11
- data/lib/super_diff/operational_sequencer.rb +0 -48
- data/lib/super_diff/operational_sequencers.rb +0 -16
- data/lib/super_diff/operational_sequencers/base.rb +0 -89
- data/lib/super_diff/operational_sequencers/hash.rb +0 -85
- data/lib/super_diff/rspec/configuration.rb +0 -31
- data/lib/super_diff/rspec/differs/partial_array.rb +0 -22
- data/lib/super_diff/rspec/differs/partial_hash.rb +0 -22
- data/lib/super_diff/rspec/differs/partial_object.rb +0 -22
- data/lib/super_diff/rspec/object_inspection/inspectors/partial_array.rb +0 -22
- data/lib/super_diff/rspec/object_inspection/inspectors/partial_hash.rb +0 -21
- data/lib/super_diff/rspec/object_inspection/inspectors/partial_object.rb +0 -21
- data/lib/super_diff/rspec/object_inspection/map_extension.rb +0 -23
- data/lib/super_diff/rspec/operational_sequencers.rb +0 -22
- data/lib/super_diff/rspec/operational_sequencers/partial_hash.rb +0 -32
@@ -0,0 +1,11 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "RSpec's `match_array` matcher" do
|
4
|
+
describe "#description" do
|
5
|
+
it "returns the correct output" do
|
6
|
+
expect(match_array([:foo, :bar, :baz]).description).to eq(
|
7
|
+
"match array with :foo, :bar and :baz",
|
8
|
+
)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -18,6 +18,14 @@ RSpec.describe "RSpec's `raise_error` matcher" do
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
context "with regular expression as message (and assuming a RuntimeError)" do
|
22
|
+
it "returns the correct output" do
|
23
|
+
expect(raise_error(/hell/).description).to eq(
|
24
|
+
%|raise error #<Exception /hell/>|,
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
21
29
|
context "with both an exception and a message" do
|
22
30
|
it "returns the correct output" do
|
23
31
|
expect(raise_error(RuntimeError, "hell").description).to eq(
|
@@ -25,5 +33,13 @@ RSpec.describe "RSpec's `raise_error` matcher" do
|
|
25
33
|
)
|
26
34
|
end
|
27
35
|
end
|
36
|
+
|
37
|
+
context "with an exception and a regular expression as message" do
|
38
|
+
it "returns the correct output" do
|
39
|
+
expect(raise_error(RuntimeError, /hell/).description).to eq(
|
40
|
+
%|raise error #<RuntimeError /hell/>|,
|
41
|
+
)
|
42
|
+
end
|
43
|
+
end
|
28
44
|
end
|
29
45
|
end
|
data/super_diff.gemspec
CHANGED
@@ -6,11 +6,10 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.authors = ["Elliot Winkler"]
|
7
7
|
s.email = ["elliot.winkler@gmail.com"]
|
8
8
|
s.homepage = "https://github.com/mcmire/super_diff"
|
9
|
-
s.summary = "
|
9
|
+
s.summary = "A better way to view differences between complex data structures in RSpec."
|
10
10
|
s.description = <<~DESC
|
11
|
-
SuperDiff is a
|
12
|
-
|
13
|
-
structures differ.
|
11
|
+
SuperDiff is a gem that hooks into RSpec to intelligently display the
|
12
|
+
differences between two data structures of any type.
|
14
13
|
DESC
|
15
14
|
s.required_ruby_version = "~> 2.4"
|
16
15
|
|
@@ -18,8 +17,6 @@ Gem::Specification.new do |s|
|
|
18
17
|
s.test_files = Dir["spec/**/*"]
|
19
18
|
s.executables = Dir["exe/**/*"].map { |f| File.basename(f) }
|
20
19
|
|
21
|
-
s.add_dependency "activerecord", "> 4.2", "< 7.0"
|
22
|
-
s.add_dependency "attr_extras"
|
23
20
|
s.add_dependency "diff-lcs"
|
24
21
|
s.add_dependency "patience_diff"
|
25
22
|
end
|
metadata
CHANGED
@@ -1,49 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Winkler
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activerecord
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '4.2'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '7.0'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '4.2'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '7.0'
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: attr_extras
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0'
|
40
|
-
type: :runtime
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
47
13
|
- !ruby/object:Gem::Dependency
|
48
14
|
name: diff-lcs
|
49
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,9 +39,8 @@ dependencies:
|
|
73
39
|
- !ruby/object:Gem::Version
|
74
40
|
version: '0'
|
75
41
|
description: |
|
76
|
-
SuperDiff is a
|
77
|
-
|
78
|
-
structures differ.
|
42
|
+
SuperDiff is a gem that hooks into RSpec to intelligently display the
|
43
|
+
differences between two data structures of any type.
|
79
44
|
email:
|
80
45
|
- elliot.winkler@gmail.com
|
81
46
|
executables: []
|
@@ -89,16 +54,16 @@ files:
|
|
89
54
|
- lib/super_diff/active_record/diff_formatters/active_record_relation.rb
|
90
55
|
- lib/super_diff/active_record/differs.rb
|
91
56
|
- lib/super_diff/active_record/differs/active_record_relation.rb
|
57
|
+
- lib/super_diff/active_record/monkey_patches.rb
|
92
58
|
- lib/super_diff/active_record/object_inspection.rb
|
93
59
|
- lib/super_diff/active_record/object_inspection/inspectors.rb
|
94
60
|
- lib/super_diff/active_record/object_inspection/inspectors/active_record_model.rb
|
95
61
|
- lib/super_diff/active_record/object_inspection/inspectors/active_record_relation.rb
|
96
|
-
- lib/super_diff/active_record/
|
97
|
-
- lib/super_diff/active_record/
|
98
|
-
- lib/super_diff/active_record/
|
99
|
-
- lib/super_diff/active_record/
|
100
|
-
- lib/super_diff/active_record/
|
101
|
-
- lib/super_diff/active_record/operational_sequencers/active_record_relation.rb
|
62
|
+
- lib/super_diff/active_record/operation_tree_builders.rb
|
63
|
+
- lib/super_diff/active_record/operation_tree_builders/active_record_model.rb
|
64
|
+
- lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb
|
65
|
+
- lib/super_diff/active_record/operation_trees.rb
|
66
|
+
- lib/super_diff/active_record/operation_trees/active_record_relation.rb
|
102
67
|
- lib/super_diff/active_support.rb
|
103
68
|
- lib/super_diff/active_support/diff_formatters.rb
|
104
69
|
- lib/super_diff/active_support/diff_formatters/hash_with_indifferent_access.rb
|
@@ -107,12 +72,12 @@ files:
|
|
107
72
|
- lib/super_diff/active_support/object_inspection.rb
|
108
73
|
- lib/super_diff/active_support/object_inspection/inspectors.rb
|
109
74
|
- lib/super_diff/active_support/object_inspection/inspectors/hash_with_indifferent_access.rb
|
110
|
-
- lib/super_diff/active_support/
|
111
|
-
- lib/super_diff/active_support/
|
112
|
-
- lib/super_diff/active_support/
|
113
|
-
- lib/super_diff/active_support/
|
114
|
-
- lib/super_diff/active_support/operational_sequencers/hash_with_indifferent_access.rb
|
75
|
+
- lib/super_diff/active_support/operation_tree_builders.rb
|
76
|
+
- lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb
|
77
|
+
- lib/super_diff/active_support/operation_trees.rb
|
78
|
+
- lib/super_diff/active_support/operation_trees/hash_with_indifferent_access.rb
|
115
79
|
- lib/super_diff/colorized_document_extensions.rb
|
80
|
+
- lib/super_diff/configuration.rb
|
116
81
|
- lib/super_diff/csi.rb
|
117
82
|
- lib/super_diff/csi/bold_sequence.rb
|
118
83
|
- lib/super_diff/csi/color.rb
|
@@ -124,47 +89,56 @@ files:
|
|
124
89
|
- lib/super_diff/csi/reset_sequence.rb
|
125
90
|
- lib/super_diff/csi/twenty_four_bit_color.rb
|
126
91
|
- lib/super_diff/csi/uncolorized_document.rb
|
127
|
-
- lib/super_diff/diff_formatter.rb
|
128
92
|
- lib/super_diff/diff_formatters.rb
|
129
93
|
- lib/super_diff/diff_formatters/array.rb
|
130
94
|
- lib/super_diff/diff_formatters/base.rb
|
131
95
|
- lib/super_diff/diff_formatters/collection.rb
|
132
96
|
- lib/super_diff/diff_formatters/custom_object.rb
|
133
97
|
- lib/super_diff/diff_formatters/default_object.rb
|
98
|
+
- lib/super_diff/diff_formatters/defaults.rb
|
134
99
|
- lib/super_diff/diff_formatters/hash.rb
|
100
|
+
- lib/super_diff/diff_formatters/main.rb
|
135
101
|
- lib/super_diff/diff_formatters/multiline_string.rb
|
136
|
-
- lib/super_diff/differ.rb
|
137
102
|
- lib/super_diff/differs.rb
|
138
103
|
- lib/super_diff/differs/array.rb
|
139
104
|
- lib/super_diff/differs/base.rb
|
140
105
|
- lib/super_diff/differs/custom_object.rb
|
141
106
|
- lib/super_diff/differs/default_object.rb
|
107
|
+
- lib/super_diff/differs/defaults.rb
|
142
108
|
- lib/super_diff/differs/empty.rb
|
143
109
|
- lib/super_diff/differs/hash.rb
|
110
|
+
- lib/super_diff/differs/main.rb
|
144
111
|
- lib/super_diff/differs/multiline_string.rb
|
145
|
-
- lib/super_diff/
|
112
|
+
- lib/super_diff/differs/time_like.rb
|
146
113
|
- lib/super_diff/equality_matchers.rb
|
147
114
|
- lib/super_diff/equality_matchers/array.rb
|
148
115
|
- lib/super_diff/equality_matchers/base.rb
|
149
116
|
- lib/super_diff/equality_matchers/default.rb
|
117
|
+
- lib/super_diff/equality_matchers/defaults.rb
|
150
118
|
- lib/super_diff/equality_matchers/hash.rb
|
119
|
+
- lib/super_diff/equality_matchers/main.rb
|
151
120
|
- lib/super_diff/equality_matchers/multiline_string.rb
|
152
121
|
- lib/super_diff/equality_matchers/primitive.rb
|
153
122
|
- lib/super_diff/equality_matchers/singleline_string.rb
|
123
|
+
- lib/super_diff/errors.rb
|
124
|
+
- lib/super_diff/errors/no_diff_formatter_available_error.rb
|
125
|
+
- lib/super_diff/errors/no_differ_available_error.rb
|
126
|
+
- lib/super_diff/errors/no_operational_sequencer_available_error.rb
|
154
127
|
- lib/super_diff/helpers.rb
|
155
|
-
- lib/super_diff/
|
156
|
-
- lib/super_diff/no_operational_sequencer_available_error.rb
|
128
|
+
- lib/super_diff/implementation_checks.rb
|
157
129
|
- lib/super_diff/object_inspection.rb
|
158
130
|
- lib/super_diff/object_inspection/inspection_tree.rb
|
159
|
-
- lib/super_diff/object_inspection/inspector.rb
|
160
131
|
- lib/super_diff/object_inspection/inspectors.rb
|
161
132
|
- lib/super_diff/object_inspection/inspectors/array.rb
|
133
|
+
- lib/super_diff/object_inspection/inspectors/base.rb
|
162
134
|
- lib/super_diff/object_inspection/inspectors/custom_object.rb
|
163
135
|
- lib/super_diff/object_inspection/inspectors/default_object.rb
|
136
|
+
- lib/super_diff/object_inspection/inspectors/defaults.rb
|
164
137
|
- lib/super_diff/object_inspection/inspectors/hash.rb
|
138
|
+
- lib/super_diff/object_inspection/inspectors/main.rb
|
165
139
|
- lib/super_diff/object_inspection/inspectors/primitive.rb
|
166
140
|
- lib/super_diff/object_inspection/inspectors/string.rb
|
167
|
-
- lib/super_diff/object_inspection/
|
141
|
+
- lib/super_diff/object_inspection/inspectors/time_like.rb
|
168
142
|
- lib/super_diff/object_inspection/nodes.rb
|
169
143
|
- lib/super_diff/object_inspection/nodes/base.rb
|
170
144
|
- lib/super_diff/object_inspection/nodes/break.rb
|
@@ -175,20 +149,25 @@ files:
|
|
175
149
|
- lib/super_diff/object_inspection/nodes/when_multiline.rb
|
176
150
|
- lib/super_diff/object_inspection/nodes/when_non_empty.rb
|
177
151
|
- lib/super_diff/object_inspection/nodes/when_singleline.rb
|
178
|
-
- lib/super_diff/
|
179
|
-
- lib/super_diff/
|
180
|
-
- lib/super_diff/
|
181
|
-
- lib/super_diff/
|
182
|
-
- lib/super_diff/
|
183
|
-
- lib/super_diff/
|
184
|
-
- lib/super_diff/
|
185
|
-
- lib/super_diff/
|
186
|
-
- lib/super_diff/
|
187
|
-
- lib/super_diff/
|
188
|
-
- lib/super_diff/
|
189
|
-
- lib/super_diff/
|
190
|
-
- lib/super_diff/
|
191
|
-
- lib/super_diff/
|
152
|
+
- lib/super_diff/operation_tree_builders.rb
|
153
|
+
- lib/super_diff/operation_tree_builders/array.rb
|
154
|
+
- lib/super_diff/operation_tree_builders/base.rb
|
155
|
+
- lib/super_diff/operation_tree_builders/custom_object.rb
|
156
|
+
- lib/super_diff/operation_tree_builders/default_object.rb
|
157
|
+
- lib/super_diff/operation_tree_builders/defaults.rb
|
158
|
+
- lib/super_diff/operation_tree_builders/hash.rb
|
159
|
+
- lib/super_diff/operation_tree_builders/main.rb
|
160
|
+
- lib/super_diff/operation_tree_builders/multiline_string.rb
|
161
|
+
- lib/super_diff/operation_tree_builders/time_like.rb
|
162
|
+
- lib/super_diff/operation_trees.rb
|
163
|
+
- lib/super_diff/operation_trees/array.rb
|
164
|
+
- lib/super_diff/operation_trees/base.rb
|
165
|
+
- lib/super_diff/operation_trees/custom_object.rb
|
166
|
+
- lib/super_diff/operation_trees/default_object.rb
|
167
|
+
- lib/super_diff/operation_trees/defaults.rb
|
168
|
+
- lib/super_diff/operation_trees/hash.rb
|
169
|
+
- lib/super_diff/operation_trees/main.rb
|
170
|
+
- lib/super_diff/operation_trees/multiline_string.rb
|
192
171
|
- lib/super_diff/operations.rb
|
193
172
|
- lib/super_diff/operations/binary_operation.rb
|
194
173
|
- lib/super_diff/operations/unary_operation.rb
|
@@ -197,17 +176,17 @@ files:
|
|
197
176
|
- lib/super_diff/rspec-rails.rb
|
198
177
|
- lib/super_diff/rspec.rb
|
199
178
|
- lib/super_diff/rspec/augmented_matcher.rb
|
200
|
-
- lib/super_diff/rspec/configuration.rb
|
201
179
|
- lib/super_diff/rspec/differ.rb
|
202
180
|
- lib/super_diff/rspec/differs.rb
|
203
181
|
- lib/super_diff/rspec/differs/collection_containing_exactly.rb
|
204
|
-
- lib/super_diff/rspec/differs/
|
205
|
-
- lib/super_diff/rspec/differs/
|
206
|
-
- lib/super_diff/rspec/differs/
|
182
|
+
- lib/super_diff/rspec/differs/collection_including.rb
|
183
|
+
- lib/super_diff/rspec/differs/hash_including.rb
|
184
|
+
- lib/super_diff/rspec/differs/object_having_attributes.rb
|
207
185
|
- lib/super_diff/rspec/matcher_text_builders.rb
|
208
186
|
- lib/super_diff/rspec/matcher_text_builders/base.rb
|
209
187
|
- lib/super_diff/rspec/matcher_text_builders/be_predicate.rb
|
210
188
|
- lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb
|
189
|
+
- lib/super_diff/rspec/matcher_text_builders/have_predicate.rb
|
211
190
|
- lib/super_diff/rspec/matcher_text_builders/match.rb
|
212
191
|
- lib/super_diff/rspec/matcher_text_builders/raise_error.rb
|
213
192
|
- lib/super_diff/rspec/matcher_text_builders/respond_to.rb
|
@@ -216,15 +195,18 @@ files:
|
|
216
195
|
- lib/super_diff/rspec/object_inspection.rb
|
217
196
|
- lib/super_diff/rspec/object_inspection/inspectors.rb
|
218
197
|
- lib/super_diff/rspec/object_inspection/inspectors/collection_containing_exactly.rb
|
219
|
-
- lib/super_diff/rspec/object_inspection/inspectors/
|
220
|
-
- lib/super_diff/rspec/object_inspection/inspectors/
|
221
|
-
- lib/super_diff/rspec/object_inspection/inspectors/
|
222
|
-
- lib/super_diff/rspec/object_inspection/
|
223
|
-
- lib/super_diff/rspec/
|
224
|
-
- lib/super_diff/rspec/
|
225
|
-
- lib/super_diff/rspec/
|
226
|
-
- lib/super_diff/rspec/
|
227
|
-
- lib/super_diff/rspec/
|
198
|
+
- lib/super_diff/rspec/object_inspection/inspectors/collection_including.rb
|
199
|
+
- lib/super_diff/rspec/object_inspection/inspectors/hash_including.rb
|
200
|
+
- lib/super_diff/rspec/object_inspection/inspectors/instance_of.rb
|
201
|
+
- lib/super_diff/rspec/object_inspection/inspectors/kind_of.rb
|
202
|
+
- lib/super_diff/rspec/object_inspection/inspectors/object_having_attributes.rb
|
203
|
+
- lib/super_diff/rspec/object_inspection/inspectors/primitive.rb
|
204
|
+
- lib/super_diff/rspec/object_inspection/inspectors/value_within.rb
|
205
|
+
- lib/super_diff/rspec/operation_tree_builders.rb
|
206
|
+
- lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb
|
207
|
+
- lib/super_diff/rspec/operation_tree_builders/collection_including.rb
|
208
|
+
- lib/super_diff/rspec/operation_tree_builders/hash_including.rb
|
209
|
+
- lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb
|
228
210
|
- lib/super_diff/version.rb
|
229
211
|
- spec/examples.txt
|
230
212
|
- spec/integration/rails/active_record_spec.rb
|
@@ -237,18 +219,27 @@ files:
|
|
237
219
|
- spec/integration/rspec/contain_exactly_matcher_spec.rb
|
238
220
|
- spec/integration/rspec/eq_matcher_spec.rb
|
239
221
|
- spec/integration/rspec/have_attributes_matcher_spec.rb
|
222
|
+
- spec/integration/rspec/have_predicate_matcher_spec.rb
|
240
223
|
- spec/integration/rspec/include_matcher_spec.rb
|
224
|
+
- spec/integration/rspec/match_array_matcher_spec.rb
|
241
225
|
- spec/integration/rspec/match_matcher_spec.rb
|
242
226
|
- spec/integration/rspec/raise_error_matcher_spec.rb
|
243
227
|
- spec/integration/rspec/respond_to_matcher_spec.rb
|
228
|
+
- spec/integration/rspec/third_party_matcher_spec.rb
|
244
229
|
- spec/integration/rspec/unhandled_errors_spec.rb
|
245
230
|
- spec/spec_helper.rb
|
246
231
|
- spec/support/colorizer.rb
|
247
232
|
- spec/support/command_runner.rb
|
248
233
|
- spec/support/integration/helpers.rb
|
234
|
+
- spec/support/integration/matchers.rb
|
249
235
|
- spec/support/integration/matchers/produce_output_when_run_matcher.rb
|
236
|
+
- spec/support/integration/test_programs/base.rb
|
237
|
+
- spec/support/integration/test_programs/plain.rb
|
238
|
+
- spec/support/integration/test_programs/rspec_active_record.rb
|
239
|
+
- spec/support/integration/test_programs/rspec_rails.rb
|
250
240
|
- spec/support/models/a.rb
|
251
241
|
- spec/support/models/active_record/person.rb
|
242
|
+
- spec/support/models/active_record/query.rb
|
252
243
|
- spec/support/models/active_record/shipping_address.rb
|
253
244
|
- spec/support/models/customer.rb
|
254
245
|
- spec/support/models/empty_class.rb
|
@@ -257,10 +248,12 @@ files:
|
|
257
248
|
- spec/support/models/person.rb
|
258
249
|
- spec/support/models/player.rb
|
259
250
|
- spec/support/models/shipping_address.rb
|
251
|
+
- spec/support/object_id.rb
|
260
252
|
- spec/support/ruby_versions.rb
|
261
253
|
- spec/support/shared_examples/active_record.rb
|
262
254
|
- spec/support/shared_examples/hash_with_indifferent_access.rb
|
263
|
-
- spec/
|
255
|
+
- spec/tmp/integration_spec.rb
|
256
|
+
- spec/unit/equality_matchers/main_spec.rb
|
264
257
|
- spec/unit/object_inspection_spec.rb
|
265
258
|
- spec/unit/rspec/matchers/be_compared_to_spec.rb
|
266
259
|
- spec/unit/rspec/matchers/be_falsey_spec.rb
|
@@ -271,7 +264,9 @@ files:
|
|
271
264
|
- spec/unit/rspec/matchers/contain_exactly_spec.rb
|
272
265
|
- spec/unit/rspec/matchers/eq_spec.rb
|
273
266
|
- spec/unit/rspec/matchers/have_attributes_spec.rb
|
267
|
+
- spec/unit/rspec/matchers/have_predicate_spec.rb
|
274
268
|
- spec/unit/rspec/matchers/include_spec.rb
|
269
|
+
- spec/unit/rspec/matchers/match_array_spec.rb
|
275
270
|
- spec/unit/rspec/matchers/match_spec.rb
|
276
271
|
- spec/unit/rspec/matchers/raise_error_spec.rb
|
277
272
|
- spec/unit/rspec/matchers/respond_to_spec.rb
|
@@ -279,7 +274,7 @@ files:
|
|
279
274
|
homepage: https://github.com/mcmire/super_diff
|
280
275
|
licenses: []
|
281
276
|
metadata: {}
|
282
|
-
post_install_message:
|
277
|
+
post_install_message:
|
283
278
|
rdoc_options: []
|
284
279
|
require_paths:
|
285
280
|
- lib
|
@@ -294,23 +289,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
289
|
- !ruby/object:Gem::Version
|
295
290
|
version: '0'
|
296
291
|
requirements: []
|
297
|
-
rubygems_version: 3.
|
298
|
-
signing_key:
|
292
|
+
rubygems_version: 3.1.2
|
293
|
+
signing_key:
|
299
294
|
specification_version: 4
|
300
|
-
summary:
|
295
|
+
summary: A better way to view differences between complex data structures in RSpec.
|
301
296
|
test_files:
|
302
297
|
- spec/spec_helper.rb
|
298
|
+
- spec/unit/equality_matchers/main_spec.rb
|
303
299
|
- spec/unit/object_inspection_spec.rb
|
304
|
-
- spec/unit/equality_matcher_spec.rb
|
305
300
|
- spec/unit/rspec/matchers/contain_exactly_spec.rb
|
306
301
|
- spec/unit/rspec/matchers/be_predicate_spec.rb
|
307
302
|
- spec/unit/rspec/matchers/raise_error_spec.rb
|
303
|
+
- spec/unit/rspec/matchers/have_predicate_spec.rb
|
308
304
|
- spec/unit/rspec/matchers/eq_spec.rb
|
309
305
|
- spec/unit/rspec/matchers/have_attributes_spec.rb
|
310
306
|
- spec/unit/rspec/matchers/match_spec.rb
|
311
307
|
- spec/unit/rspec/matchers/be_spec.rb
|
312
308
|
- spec/unit/rspec/matchers/be_compared_to_spec.rb
|
313
309
|
- spec/unit/rspec/matchers/respond_to_spec.rb
|
310
|
+
- spec/unit/rspec/matchers/match_array_spec.rb
|
314
311
|
- spec/unit/rspec/matchers/be_nil_spec.rb
|
315
312
|
- spec/unit/rspec/matchers/be_falsey_spec.rb
|
316
313
|
- spec/unit/rspec/matchers/be_truthy_spec.rb
|
@@ -324,14 +321,23 @@ test_files:
|
|
324
321
|
- spec/integration/rspec/be_matcher_spec.rb
|
325
322
|
- spec/integration/rspec/respond_to_matcher_spec.rb
|
326
323
|
- spec/integration/rspec/match_matcher_spec.rb
|
324
|
+
- spec/integration/rspec/match_array_matcher_spec.rb
|
325
|
+
- spec/integration/rspec/third_party_matcher_spec.rb
|
327
326
|
- spec/integration/rspec/have_attributes_matcher_spec.rb
|
328
327
|
- spec/integration/rspec/raise_error_matcher_spec.rb
|
329
328
|
- spec/integration/rspec/eq_matcher_spec.rb
|
329
|
+
- spec/integration/rspec/have_predicate_matcher_spec.rb
|
330
330
|
- spec/integration/rspec/contain_exactly_matcher_spec.rb
|
331
331
|
- spec/integration/rspec/include_matcher_spec.rb
|
332
332
|
- spec/integration/rails/active_record_spec.rb
|
333
333
|
- spec/integration/rails/hash_with_indifferent_access_spec.rb
|
334
|
+
- spec/support/object_id.rb
|
335
|
+
- spec/support/integration/test_programs/base.rb
|
336
|
+
- spec/support/integration/test_programs/rspec_rails.rb
|
337
|
+
- spec/support/integration/test_programs/plain.rb
|
338
|
+
- spec/support/integration/test_programs/rspec_active_record.rb
|
334
339
|
- spec/support/integration/helpers.rb
|
340
|
+
- spec/support/integration/matchers.rb
|
335
341
|
- spec/support/integration/matchers/produce_output_when_run_matcher.rb
|
336
342
|
- spec/support/models/item.rb
|
337
343
|
- spec/support/models/customer.rb
|
@@ -339,6 +345,7 @@ test_files:
|
|
339
345
|
- spec/support/models/player.rb
|
340
346
|
- spec/support/models/active_record/shipping_address.rb
|
341
347
|
- spec/support/models/active_record/person.rb
|
348
|
+
- spec/support/models/active_record/query.rb
|
342
349
|
- spec/support/models/a.rb
|
343
350
|
- spec/support/models/shipping_address.rb
|
344
351
|
- spec/support/models/order.rb
|
@@ -348,3 +355,4 @@ test_files:
|
|
348
355
|
- spec/support/colorizer.rb
|
349
356
|
- spec/support/shared_examples/hash_with_indifferent_access.rb
|
350
357
|
- spec/support/shared_examples/active_record.rb
|
358
|
+
- spec/tmp/integration_spec.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module SuperDiff
|
2
|
-
module ActiveRecord
|
3
|
-
module ObjectInspection
|
4
|
-
module MapExtension
|
5
|
-
def call(object)
|
6
|
-
case object
|
7
|
-
when ::ActiveRecord::Base
|
8
|
-
Inspectors::ActiveRecordModel
|
9
|
-
when ::ActiveRecord::Relation
|
10
|
-
Inspectors::ActiveRecordRelation
|
11
|
-
else
|
12
|
-
super
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|