super_diff 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -22
  3. data/lib/super_diff.rb +1 -7
  4. data/lib/super_diff/colorized_document_extensions.rb +4 -4
  5. data/lib/super_diff/configuration.rb +32 -22
  6. data/lib/super_diff/csi.rb +2 -1
  7. data/lib/super_diff/diff_formatters/collection.rb +1 -1
  8. data/lib/super_diff/diff_formatters/multiline_string.rb +4 -4
  9. data/lib/super_diff/equality_matchers/array.rb +2 -2
  10. data/lib/super_diff/equality_matchers/default.rb +2 -2
  11. data/lib/super_diff/equality_matchers/hash.rb +2 -2
  12. data/lib/super_diff/equality_matchers/multiline_string.rb +2 -2
  13. data/lib/super_diff/equality_matchers/primitive.rb +2 -2
  14. data/lib/super_diff/equality_matchers/singleline_string.rb +2 -2
  15. data/lib/super_diff/gem_version.rb +45 -0
  16. data/lib/super_diff/operation_trees/base.rb +2 -0
  17. data/lib/super_diff/recursion_guard.rb +2 -0
  18. data/lib/super_diff/rspec.rb +7 -0
  19. data/lib/super_diff/rspec/matcher_text_builders/base.rb +7 -7
  20. data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +6 -6
  21. data/lib/super_diff/rspec/matcher_text_builders/contain_exactly.rb +1 -1
  22. data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +4 -4
  23. data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +1 -1
  24. data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +5 -5
  25. data/lib/super_diff/rspec/monkey_patches.rb +22 -14
  26. data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +12 -1
  27. data/lib/super_diff/version.rb +1 -1
  28. data/spec/examples.txt +390 -397
  29. data/spec/integration/rspec/be_falsey_matcher_spec.rb +10 -10
  30. data/spec/integration/rspec/be_matcher_spec.rb +100 -100
  31. data/spec/integration/rspec/be_nil_matcher_spec.rb +10 -10
  32. data/spec/integration/rspec/be_predicate_matcher_spec.rb +103 -103
  33. data/spec/integration/rspec/be_truthy_matcher_spec.rb +10 -10
  34. data/spec/integration/rspec/contain_exactly_matcher_spec.rb +107 -107
  35. data/spec/integration/rspec/eq_matcher_spec.rb +230 -230
  36. data/spec/integration/rspec/have_attributes_matcher_spec.rb +129 -129
  37. data/spec/integration/rspec/have_predicate_matcher_spec.rb +65 -65
  38. data/spec/integration/rspec/include_matcher_spec.rb +73 -73
  39. data/spec/integration/rspec/match_array_matcher_spec.rb +149 -107
  40. data/spec/integration/rspec/match_matcher_spec.rb +274 -274
  41. data/spec/integration/rspec/raise_error_matcher_spec.rb +86 -86
  42. data/spec/integration/rspec/respond_to_matcher_spec.rb +240 -240
  43. data/spec/integration/rspec/third_party_matcher_spec.rb +8 -8
  44. data/spec/integration/rspec/unhandled_errors_spec.rb +5 -5
  45. data/spec/spec_helper.rb +22 -13
  46. data/spec/support/integration/helpers.rb +6 -2
  47. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +1 -1
  48. data/spec/support/integration/test_programs/base.rb +2 -0
  49. data/spec/support/integration/test_programs/rspec_active_record.rb +1 -1
  50. data/spec/support/integration/test_programs/rspec_active_support.rb +17 -0
  51. data/spec/support/integration/test_programs/rspec_rails.rb +1 -1
  52. data/spec/support/shared_examples/active_record.rb +108 -108
  53. data/spec/support/shared_examples/hash_with_indifferent_access.rb +196 -232
  54. data/spec/unit/equality_matchers/main_spec.rb +403 -403
  55. data/super_diff.gemspec +3 -1
  56. metadata +25 -4
data/super_diff.gemspec CHANGED
@@ -7,16 +7,18 @@ Gem::Specification.new do |s|
7
7
  s.email = ["elliot.winkler@gmail.com"]
8
8
  s.homepage = "https://github.com/mcmire/super_diff"
9
9
  s.summary = "A better way to view differences between complex data structures in RSpec."
10
+ s.license = "MIT"
10
11
  s.description = <<~DESC
11
12
  SuperDiff is a gem that hooks into RSpec to intelligently display the
12
13
  differences between two data structures of any type.
13
14
  DESC
14
- s.required_ruby_version = "~> 2.4"
15
+ s.required_ruby_version = [">= 2.4", "< 4"]
15
16
 
16
17
  s.files = ["README.md", "super_diff.gemspec"] + Dir["lib/**/*"]
17
18
  s.test_files = Dir["spec/**/*"]
18
19
  s.executables = Dir["exe/**/*"].map { |f| File.basename(f) }
19
20
 
21
+ s.add_dependency "attr_extras", '>= 6.2.4'
20
22
  s.add_dependency "diff-lcs"
21
23
  s.add_dependency "patience_diff"
22
24
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-19 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: attr_extras
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.2.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 6.2.4
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: diff-lcs
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -124,6 +138,7 @@ files:
124
138
  - lib/super_diff/errors/no_diff_formatter_available_error.rb
125
139
  - lib/super_diff/errors/no_differ_available_error.rb
126
140
  - lib/super_diff/errors/no_operational_sequencer_available_error.rb
141
+ - lib/super_diff/gem_version.rb
127
142
  - lib/super_diff/helpers.rb
128
143
  - lib/super_diff/implementation_checks.rb
129
144
  - lib/super_diff/object_inspection.rb
@@ -236,6 +251,7 @@ files:
236
251
  - spec/support/integration/test_programs/base.rb
237
252
  - spec/support/integration/test_programs/plain.rb
238
253
  - spec/support/integration/test_programs/rspec_active_record.rb
254
+ - spec/support/integration/test_programs/rspec_active_support.rb
239
255
  - spec/support/integration/test_programs/rspec_rails.rb
240
256
  - spec/support/models/a.rb
241
257
  - spec/support/models/active_record/person.rb
@@ -272,7 +288,8 @@ files:
272
288
  - spec/unit/rspec/matchers/respond_to_spec.rb
273
289
  - super_diff.gemspec
274
290
  homepage: https://github.com/mcmire/super_diff
275
- licenses: []
291
+ licenses:
292
+ - MIT
276
293
  metadata: {}
277
294
  post_install_message:
278
295
  rdoc_options: []
@@ -280,9 +297,12 @@ require_paths:
280
297
  - lib
281
298
  required_ruby_version: !ruby/object:Gem::Requirement
282
299
  requirements:
283
- - - "~>"
300
+ - - ">="
284
301
  - !ruby/object:Gem::Version
285
302
  version: '2.4'
303
+ - - "<"
304
+ - !ruby/object:Gem::Version
305
+ version: '4'
286
306
  required_rubygems_version: !ruby/object:Gem::Requirement
287
307
  requirements:
288
308
  - - ">="
@@ -335,6 +355,7 @@ test_files:
335
355
  - spec/support/integration/test_programs/base.rb
336
356
  - spec/support/integration/test_programs/rspec_rails.rb
337
357
  - spec/support/integration/test_programs/plain.rb
358
+ - spec/support/integration/test_programs/rspec_active_support.rb
338
359
  - spec/support/integration/test_programs/rspec_active_record.rb
339
360
  - spec/support/integration/helpers.rb
340
361
  - spec/support/integration/matchers.rb