super_diff 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c861fd38801f1faab083c1e4858be0d3d1b2f51a820187fb7b99c7deb6c7f80b
4
- data.tar.gz: f927f08a93afab351bfca7450d84baca76f9e06ff8b73800176a7eb94e85a674
3
+ metadata.gz: a5427cb2217992c9dffd57826837caaa750ddcd422625498c3bca9cf40ae8e32
4
+ data.tar.gz: 540a3e3ea47bc98c4abf45ff6ff216563f70f1492bb2c06a54525b6414b306ae
5
5
  SHA512:
6
- metadata.gz: 6cf4d0be42042cc4d5b305c5f3dc3b32b6349b502925e3f5527a7073276cfd8de8ee700634550d28dd69d499a717d663d0400436a5a39698f35e48cd6fbddec6
7
- data.tar.gz: 86f41e09234a19df5337e1c0bb6f9d49bf456586239dc85e5301b56b7779a9227873b5dc4278e590a966934634a3ace9fa9ac99a1802cd82cdb3e4847bd8103b
6
+ metadata.gz: 1bf06c03ce556532384242e0193628bae55134e3edf65003e1d0b7a1015e25af6f9ce68bd23a7ca2ebadddb0093103a643f9bb742116d2456f20146bb948f380
7
+ data.tar.gz: c32489d6915ac9f7fc3cf1c0427683977b3a569a99e36a7d8e47f1209e74efcf3f86b3986b1e40ed51d2321d89f1e8530bdda79352c1d53fd94798370f2261de
@@ -729,7 +729,7 @@ module RSpec
729
729
  end
730
730
 
731
731
  def match_array(items)
732
- BuiltIn::MatchArray.new(items)
732
+ BuiltIn::MatchArray.new(items.is_a?(String) ? [items] : items)
733
733
  end
734
734
  alias_matcher :an_array_matching, :match_array
735
735
  end
@@ -1,3 +1,3 @@
1
1
  module SuperDiff
2
- VERSION = "0.5.2".freeze
2
+ VERSION = "0.5.3".freeze
3
3
  end
@@ -369,4 +369,46 @@ RSpec.describe "Integration with RSpec's #match_array matcher", type: :integrati
369
369
  end
370
370
  end
371
371
  end
372
+
373
+ context "when the input value is a string" do
374
+ it "produces the correct failure message when used in the positive" do
375
+ as_both_colored_and_uncolored do |color_enabled|
376
+ snippet = <<~TEST.strip
377
+ expected = "Einie"
378
+ actual = ["Marty", "Jennifer", "Doc"]
379
+ expect(actual).to match_array(expected)
380
+ TEST
381
+ program = make_plain_test_program(
382
+ snippet,
383
+ color_enabled: color_enabled,
384
+ )
385
+
386
+ expected_output = build_expected_output(
387
+ color_enabled: color_enabled,
388
+ snippet: %|expect(actual).to match_array(expected)|,
389
+ expectation: proc {
390
+ line do
391
+ plain "Expected "
392
+ beta %|["Marty", "Jennifer", "Doc"]|
393
+ plain " to match array with "
394
+ alpha %|"Einie"|
395
+ plain "."
396
+ end
397
+ },
398
+ diff: proc {
399
+ plain_line %| [|
400
+ plain_line %| "Marty",|
401
+ plain_line %| "Jennifer",|
402
+ plain_line %| "Doc",|
403
+ alpha_line %|- "Einie"|
404
+ plain_line %| ]|
405
+ },
406
+ )
407
+
408
+ expect(program).
409
+ to produce_output_when_run(expected_output).
410
+ in_color(color_enabled)
411
+ end
412
+ end
413
+ end
372
414
  end
@@ -7,6 +7,7 @@ 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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
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-09-04 00:00:00.000000000 Z
11
+ date: 2020-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_extras
@@ -285,7 +285,8 @@ files:
285
285
  - spec/unit/rspec/matchers/respond_to_spec.rb
286
286
  - super_diff.gemspec
287
287
  homepage: https://github.com/mcmire/super_diff
288
- licenses: []
288
+ licenses:
289
+ - MIT
289
290
  metadata: {}
290
291
  post_install_message:
291
292
  rdoc_options: []