elabs_matchers 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -2
- data/{development.txt → development.md} +2 -2
- data/history.txt +6 -0
- data/lib/elabs_matchers/matchers/be_valid_with.rb +1 -1
- data/lib/elabs_matchers/matchers/only_include.rb +10 -0
- data/lib/elabs_matchers/version.rb +1 -1
- data/spec/elabs_matchers/matchers/only_include_spec.rb +13 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 764469411826ae33c1be2491791a22ac35d8e89687c989360cd69fdcc4588a54
|
4
|
+
data.tar.gz: 9d99ee28c4935b3dffada4cc265fdfbae3ef66b088ac814e68d6b1455a6f3c63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3ab4350c66faad2115534871c6cc207cf66dc6cb13cfde7a95e3d58f1ffbfa3a814aa48407303f5697bd27cc316a52ab5832570a441d35d3379bf175687d7d5
|
7
|
+
data.tar.gz: d3036201216b23d22fe9c735206a53c2c95ced67f5750d3b86c37489124c963f37205dccfdb9eb5aa39af411512334f7b6c125b38441112e6da5a5f3eb39e158
|
data/README.md
CHANGED
@@ -24,7 +24,6 @@ gem "elabs_matchers"
|
|
24
24
|
```ruby
|
25
25
|
record.should be_valid_with("Blog post").as(:title)
|
26
26
|
hash.contain_hash({ "baz" => "bar" })
|
27
|
-
array.only_include("bar", "foo")
|
28
27
|
record.should persist(:title, "Blog post")
|
29
28
|
```
|
30
29
|
|
@@ -79,7 +78,7 @@ The gem's test suite should also serve as detailed documentation for each matche
|
|
79
78
|
|
80
79
|
## Development
|
81
80
|
|
82
|
-
See [
|
81
|
+
See [development.md](https://github.com/elabs/elabs_matchers/blob/master/development.md)
|
83
82
|
|
84
83
|
## Contributors
|
85
84
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
## Setting up:
|
2
|
-
|
2
|
+
|
3
3
|
1. Fork the gem
|
4
4
|
2. Clone you fork to your local machine
|
5
5
|
3. Run:
|
@@ -8,7 +8,7 @@
|
|
8
8
|
rspec
|
9
9
|
|
10
10
|
## Pull requests:
|
11
|
-
|
11
|
+
|
12
12
|
Pull requests are appreciated. Before submitting please consider the following:
|
13
13
|
|
14
14
|
* Public methods are documented.
|
data/history.txt
CHANGED
@@ -7,6 +7,8 @@ module ElabsMatchers
|
|
7
7
|
attr_reader :actual
|
8
8
|
|
9
9
|
def matches?(actual)
|
10
|
+
deprecated
|
11
|
+
|
10
12
|
@actual = actual
|
11
13
|
elements.uniq.length == elements.length and
|
12
14
|
actual.length == elements.length and
|
@@ -22,6 +24,14 @@ module ElabsMatchers
|
|
22
24
|
"Expected #{actual.inspect} to not only include #{elements.inspect}, but it did."
|
23
25
|
end
|
24
26
|
alias_method :failure_message_for_should_not, :failure_message_when_negated
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def deprecated
|
31
|
+
warn %Q{
|
32
|
+
[DEPRECATION] `only_include` is deprecated. Please use rspec's `contain_exactly` instead. Called from #{Kernel.caller.first}
|
33
|
+
}
|
34
|
+
end
|
25
35
|
end
|
26
36
|
|
27
37
|
##
|
@@ -4,6 +4,10 @@ describe ElabsMatchers::Matchers::OnlyInclude do
|
|
4
4
|
subject { %w[foo bar] }
|
5
5
|
|
6
6
|
describe "#only_include" do
|
7
|
+
before do
|
8
|
+
allow_any_instance_of(ElabsMatchers::Matchers::OnlyInclude::OnlyIncludeMatcher).to receive(:deprecated)
|
9
|
+
end
|
10
|
+
|
7
11
|
it "returns true when all the elements are passed in the wrong order" do
|
8
12
|
should only_include("bar", "foo")
|
9
13
|
expect { should only_include("quox", "foo") }.to fail_assertion
|
@@ -28,5 +32,14 @@ describe ElabsMatchers::Matchers::OnlyInclude do
|
|
28
32
|
should_not only_include("foo", "bar", "baz")
|
29
33
|
expect { should_not only_include("foo", "bar") }.to fail_assertion
|
30
34
|
end
|
35
|
+
|
36
|
+
it "is deprecated" do
|
37
|
+
matcher = ElabsMatchers::Matchers::OnlyInclude::OnlyIncludeMatcher.new(
|
38
|
+
elements: %w[foo bar]
|
39
|
+
)
|
40
|
+
allow(matcher).to receive(:deprecated)
|
41
|
+
matcher.matches?("foo")
|
42
|
+
expect(matcher).to have_received(:deprecated)
|
43
|
+
end
|
31
44
|
end
|
32
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elabs_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Everyone at Elabs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|
@@ -148,7 +148,7 @@ files:
|
|
148
148
|
- Gemfile
|
149
149
|
- README.md
|
150
150
|
- Rakefile
|
151
|
-
- development.
|
151
|
+
- development.md
|
152
152
|
- doc/ElabsMatchers.html
|
153
153
|
- doc/ElabsMatchers/Helpers.html
|
154
154
|
- doc/ElabsMatchers/Helpers/Fixtures.html
|
@@ -245,8 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
- !ruby/object:Gem::Version
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
|
-
|
249
|
-
rubygems_version: 2.6.14
|
248
|
+
rubygems_version: 3.2.25
|
250
249
|
signing_key:
|
251
250
|
specification_version: 4
|
252
251
|
summary: Provides a set of useful rspec matchers
|