rspec_typeof 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef6624622531821b9be14f5bfb5e71c36e1b3d1f
4
- data.tar.gz: e9f6eeb08cc629b200d51121ffa490bd292cc8ae
3
+ metadata.gz: 6720f93748c4645d8032478e17562dbb6ee76520
4
+ data.tar.gz: d4e38622673e41d4bbc30bb735da06ac28cdc1c9
5
5
  SHA512:
6
- metadata.gz: 0f48444dfac5bfd2dae8646e64945662a30f5a2fc4f34cc432076c4fb9ca8a8ca9f62ba0654f1c64e3bf595903c097568687055e265264e05268a7596f2b1128
7
- data.tar.gz: 502ef713daa7b3a26c88297deb4f3c42d59c5241618ac0ff5cdda2f7fc04e4320d044275ff05d405f89732f52b33df364f041a4de80120dfd49ec35fba3cd8ba
6
+ metadata.gz: cf94e12ece6037703a9414bf218748ccfd7738cf1c4724fdba280f3beca165acc0ff5fdc22542dfefeb4b6f94cf33a8a928126515de8e09a38e2c76d8e068534
7
+ data.tar.gz: 59d1489b57815dd821353a93c50fe3184f0961fa8df0e7cdad4726aa2519404e31f9d16e94a506313bb3a3d3d9d7495b99d697bc7e5041629bd31a1ba7da6f42
data/README.md CHANGED
@@ -22,7 +22,6 @@ And then execute:
22
22
 
23
23
 
24
24
  ```ruby
25
-
26
25
  expect(true).to typeof(:true) or expect(true).to type_of(:true)
27
26
 
28
27
  expect(true).to typeof(:string_or_nil_or_true) or expect(true).to type_of(:string_or_nil_or_true)
@@ -37,7 +36,9 @@ expect({string: 'string', fixnum: 2, hash: {}, array: [], custom_class: CustomCl
37
36
 
38
37
  expect(['a', 'b', 'c']).to typeof(:array_of_string)
39
38
 
40
- expect(['a', 'b', 1]).to typeof(:array_of_string_or_fixnum)
39
+ expect(['a', 'b', 1]).to typeof(:array_of_string_or_integer)
40
+
41
+ expect(1).to typeof(:numeric)
41
42
  ```
42
43
 
43
44
  ## Contributing
@@ -7,7 +7,9 @@ RSpec::Matchers.define :typeof do |expected_types|
7
7
  'nil' => 'NilClass',
8
8
  'false' => 'FalseClass',
9
9
  'true' => 'TrueClass',
10
- 'boolean' => ['TrueClass', 'FalseClass']
10
+ 'boolean' => ['TrueClass', 'FalseClass'],
11
+ 'integer' => ['Fixnum', 'Bignum'],
12
+ 'numeric' => ['Fixnum', 'Bignum', 'Float', 'Rational', 'BigDecimal']
11
13
  }.freeze
12
14
 
13
15
  types = expected_types
@@ -22,7 +24,7 @@ RSpec::Matchers.define :typeof do |expected_types|
22
24
  expect(actual).to satisfy do |x|
23
25
  if expected_types.to_s.scan(/^array_of_\w+/).length > 0
24
26
  return false unless x.is_a? Array
25
-
27
+
26
28
  x.all? { |el| types.include?(el.class.name) }
27
29
  else
28
30
  types.include?(x.class.name)
@@ -1,3 +1,3 @@
1
1
  module RspecTypeof
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_typeof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vovchuk Max
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-03 00:00:00.000000000 Z
11
+ date: 2016-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec