rspec_typeof 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1426d0b05757a0ef41ef3e543da0af2ea550dedb
4
- data.tar.gz: 7beaef04dab242ac6a7fbb85572de28df5457e85
3
+ metadata.gz: 304b54494c43ca8eed064e6965b27b8abd4a0004
4
+ data.tar.gz: 1c40686275cf7225e71102c666e82752dcd90b70
5
5
  SHA512:
6
- metadata.gz: d219dc5ffe5730cbc835701d426098a89e2570d7daff351f04533dcdd0993b0fd0d4284c773cfce42a75d6b7107f15b2dcea124b79f6732125739ba2d0863146
7
- data.tar.gz: af4ad29d3e98b935812cea14b461fc71a52cc70d23d8e90633be60a105295cb6e7a53f8e3d236300a70fc174fc67ed8ca007100ef5fcd8dbcf97dd60f03c79c9
6
+ metadata.gz: f2b08e264523b075f80a6bc323289da1d71819be2a075bf8c414773daabe0fbb3d27059a94ea7e1cd53e2ecf25f69415b3980224c8f96919449e806a75f2d5b4
7
+ data.tar.gz: 5d4577278d3febadeb79422fba9b06e5e3908d12d0971be0ce6265ce7caeacf68166063ab6412e8e703799e285cb97f7ee25634ba11e5006fd6df616cee77ec6
@@ -8,7 +8,6 @@ RSpec::Matchers.define :typeof do |expected_types|
8
8
  'boolean' => ['TrueClass', 'FalseClass']
9
9
  }.freeze
10
10
 
11
- array_matching = false
12
11
  types = expected_types
13
12
  .to_s
14
13
  .gsub(/^array_of_/, '')
@@ -18,17 +17,15 @@ RSpec::Matchers.define :typeof do |expected_types|
18
17
  .flatten
19
18
  .uniq
20
19
 
21
- match do |actual|
22
- expect(actual).to satisfy do |x|
23
- if expected_types.to_s.scan(/^array_of_\w+/).length > 0
24
- x.all? { |el| types.include?(el.class.name) }
25
- else
26
- types.include?(x.class.name)
27
- end
20
+ match do |actual|
21
+ expect(actual).to satisfy do |x|
22
+ if expected_types.to_s.scan(/^array_of_\w+/).length > 0
23
+ x.all? { |el| types.include?(el.class.name) }
24
+ else
25
+ types.include?(x.class.name)
28
26
  end
29
27
  end
30
-
31
-
28
+ end
32
29
 
33
30
  failure_message do |actual|
34
31
  "expected that #{actual} would be an instance of #{types.join(' or ')}"
@@ -1,3 +1,3 @@
1
1
  module RspecTypeof
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = %q{Add typeof matcher to Rspec}
14
14
  spec.homepage = "https://github.com/Somiel/rspec_typeof"
15
15
 
16
-
16
+ spec.licenses = ['MIT']
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_typeof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vovchuk Max
@@ -74,7 +74,8 @@ files:
74
74
  - lib/utils/string.rb
75
75
  - rspec_typeof.gemspec
76
76
  homepage: https://github.com/Somiel/rspec_typeof
77
- licenses: []
77
+ licenses:
78
+ - MIT
78
79
  metadata: {}
79
80
  post_install_message:
80
81
  rdoc_options: []