rspec_typeof 0.3.1 → 0.3.3
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 +4 -4
- data/.travis.yml +4 -1
- data/Gemfile +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +7 -3
- data/lib/rspec_typeof/typeof.rb +2 -0
- data/lib/rspec_typeof/version.rb +1 -1
- data/rspec_typeof.gemspec +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e92f0934e150361b30051d9e34e8d780e8f987fb
|
4
|
+
data.tar.gz: 98677e3ea77e66f4ba10ef45826b65e3bd51850b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f193db7ecf771bc39294245aa4ccb2f8580aa7817cd0af6ba656650eda90bdc4aac5cbe4e6bb4693901ce6a2e5af2f563652c6e45639d7079540c1df917fd6dd
|
7
|
+
data.tar.gz: 4c79877b5749d634e0d6b0927490451b91108bafef007671826c1e0d9ac464da154368b290df44956fab1c53ea4dee674f4ce2d61f248c32a3bd8f3c3ed3cb53
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# RspecTypeof
|
2
|
+
[](https://badge.fury.io/rb/rspec_typeof)
|
3
|
+
[](https://codeclimate.com/github/Somiel/rspec_typeof)
|
2
4
|
[](https://travis-ci.org/Somiel/rspec_typeof)
|
3
5
|
|
4
|
-
Welcome to rspec_typeof, with this gem you can use "typeof" expectation
|
6
|
+
Welcome to rspec_typeof, with this gem you can use "typeof" expectation in your tests for comfortable data format matching of both single data examples and data collections
|
5
7
|
|
6
8
|
|
7
9
|
## Installation
|
@@ -20,13 +22,15 @@ And then execute:
|
|
20
22
|
|
21
23
|
|
22
24
|
```ruby
|
25
|
+
expect(true).to typeof(:true)
|
26
|
+
|
23
27
|
expect(true).to typeof(:string_or_nil_or_true)
|
24
28
|
|
25
|
-
expect({
|
29
|
+
expect({string: 'string', fixnum: 2, hash: {}, array: [], custom_class: CustomClass.new}).to match(
|
26
30
|
string: typeof(:string_or_nil),
|
27
31
|
fixnum: typeof(:fixnum_or_nil),
|
28
32
|
hash: typeof(:hash_or_nil_or_string),
|
29
|
-
array: typeof(:
|
33
|
+
array: typeof(:array_or_nil),
|
30
34
|
custom_class: typeof(:custom_class_or_nil_or_array)
|
31
35
|
)
|
32
36
|
|
data/lib/rspec_typeof/typeof.rb
CHANGED
@@ -20,6 +20,8 @@ RSpec::Matchers.define :typeof do |expected_types|
|
|
20
20
|
match do |actual|
|
21
21
|
expect(actual).to satisfy do |x|
|
22
22
|
if expected_types.to_s.scan(/^array_of_\w+/).length > 0
|
23
|
+
return false unless x.is_a? Array
|
24
|
+
|
23
25
|
x.all? { |el| types.include?(el.class.name) }
|
24
26
|
else
|
25
27
|
types.include?(x.class.name)
|
data/lib/rspec_typeof/version.rb
CHANGED
data/rspec_typeof.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Vovchuk Max"]
|
10
10
|
spec.email = ["vovchuk.max@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Add typeof matcher to
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Add typeof data type matcher to RSpec}
|
13
|
+
spec.description = %q{This gem provides comfortable using of data types mathching in your RSpec tests}
|
14
14
|
spec.homepage = "https://github.com/Somiel/rspec_typeof"
|
15
15
|
|
16
16
|
spec.licenses = ['MIT']
|
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.3.
|
4
|
+
version: 0.3.3
|
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-11-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -52,7 +52,8 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '11.2'
|
55
|
-
description:
|
55
|
+
description: This gem provides comfortable using of data types mathching in your RSpec
|
56
|
+
tests
|
56
57
|
email:
|
57
58
|
- vovchuk.max@gmail.com
|
58
59
|
executables: []
|
@@ -96,5 +97,5 @@ rubyforge_project:
|
|
96
97
|
rubygems_version: 2.5.1
|
97
98
|
signing_key:
|
98
99
|
specification_version: 4
|
99
|
-
summary: Add typeof matcher to
|
100
|
+
summary: Add typeof data type matcher to RSpec
|
100
101
|
test_files: []
|