rspec-hal 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +16 -3
- data/gemfiles/rspec2_14.gemfile +7 -0
- data/gemfiles/rspec3_0.gemfile +7 -0
- data/lib/rspec/hal/matchers/hal_matcher_helpers.rb +5 -0
- data/lib/rspec/hal/matchers/templated_relation_matcher.rb +16 -12
- data/lib/rspec/hal/version.rb +1 -1
- data/spec/rspec/hal/matchers/templated_relation_matcher_spec.rb +3 -3
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1350f30e17586dd2a1519b0ccf17b97061c7e6de
|
4
|
+
data.tar.gz: 273bc7a271b118ee026ddad7653c7b504f4558ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb1e494d0e157695a5bda7154e5c3cd5819a3b9207ff61b2eb265291510846a317cb7b05d212bd415e91fa2b96bb8ebc4774c73a775ca5ead8cda5518b1aaf0
|
7
|
+
data.tar.gz: 7c25b64edee190f075d92703d488d8421b4fe51dd47e67b32ec5139a37407ce1b650a7e864ccd6da6488bdbc65d18c44e2d982c7bce345e43bf8f1204a990da3
|
data/.travis.yml
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
-
|
5
|
-
-
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
- 2.1.1
|
6
6
|
- jruby-19mode # JRuby in 1.9 mode
|
7
|
+
|
8
|
+
gemfile:
|
9
|
+
- gemfiles/rspec2_14.gemfile
|
10
|
+
- gemfiles/rspec3_0.gemfile
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
exclude:
|
14
|
+
- rvm: 1.9.3
|
15
|
+
gemfile: gemfiles/rspec3_0.gemfile
|
16
|
+
- rvm: 2.0.0
|
17
|
+
gemfile: gemfiles/rspec3_0.gemfile
|
18
|
+
- rvm: jruby-19mode
|
19
|
+
gemfile: gemfiles/rspec3_0.gemfile
|
@@ -14,6 +14,11 @@ module RSpec
|
|
14
14
|
end
|
15
15
|
end.new
|
16
16
|
|
17
|
+
def repr=(jsonish)
|
18
|
+
@repr = parse jsonish
|
19
|
+
end
|
20
|
+
attr_reader :repr
|
21
|
+
|
17
22
|
# Returns string composed of the specified clauses with proper
|
18
23
|
# spacing between them. Empty and nil clauses are ignored.
|
19
24
|
def sentencize(*clauses)
|
@@ -16,21 +16,25 @@ module RSpec
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def matches?(jsonish)
|
19
|
-
repr =
|
19
|
+
self.repr = jsonish
|
20
20
|
|
21
21
|
repr.raw_related_hrefs(link_rel){[]}
|
22
|
+
.tap{|it| if it.none?
|
23
|
+
@outcome = :no_relations
|
24
|
+
return false
|
25
|
+
end }
|
22
26
|
.select{|it| it.respond_to? :expand}
|
23
|
-
.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
.tap{|it| if it.none?
|
28
|
+
@outcome = :no_templates
|
29
|
+
return false
|
30
|
+
end }
|
31
|
+
.select{|it| expected === it.pattern }
|
32
|
+
.tap{|it| if it.none?
|
33
|
+
@outcome = :none_matched
|
34
|
+
return false
|
35
|
+
end }
|
36
|
+
|
37
|
+
true
|
34
38
|
end
|
35
39
|
|
36
40
|
def failure_message
|
data/lib/rspec/hal/version.rb
CHANGED
@@ -54,13 +54,13 @@ describe RSpec::Hal::Matchers::TemplatedRelationMatcher do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
context "failed due to sub-matcher failure matcher" do
|
57
|
-
subject(:matcher) { described_class.new(a_link_rel, match(
|
57
|
+
subject(:matcher) { described_class.new(a_link_rel, match(/absent/)) }
|
58
58
|
before do
|
59
|
-
matcher.matches?
|
59
|
+
matcher.matches? json_str_w_link
|
60
60
|
end
|
61
61
|
|
62
62
|
specify { expect(matcher.failure_message)
|
63
|
-
.to match %r(Expected templated `#{a_link_rel}` link match(?:ing)?
|
63
|
+
.to match %r(Expected templated `#{a_link_rel}` link match(?:ing)? /absent/ but found none) }
|
64
64
|
end
|
65
65
|
|
66
66
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-hal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
@@ -85,6 +85,8 @@ files:
|
|
85
85
|
- LICENSE.txt
|
86
86
|
- README.md
|
87
87
|
- Rakefile
|
88
|
+
- gemfiles/rspec2_14.gemfile
|
89
|
+
- gemfiles/rspec3_0.gemfile
|
88
90
|
- lib/rspec-hal.rb
|
89
91
|
- lib/rspec/hal.rb
|
90
92
|
- lib/rspec/hal/matchers.rb
|