restful-matchers 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: 1ebf655f0413ddd8082f291573ce0072759b5578
4
- data.tar.gz: 60d70c76fdc3491752fec9639bfc87129b759b04
3
+ metadata.gz: 21f1e56c6b101a636fddd9f272937c24697761e2
4
+ data.tar.gz: d32552d0585012538ebdbc5b603b5497101cf74f
5
5
  SHA512:
6
- metadata.gz: 94c24744350d3810781943ea6e4c6db4029c8fbc82a8fab38ce65d65b31daca232d8fdf0cbf6b039a0b95365b0f9d952a5836ca290bd17063cc15bc3c915fbb2
7
- data.tar.gz: 73146b6bae167a0443c4cb072220bab85b9b07c39c8a59906ffa9648c70f8d607fd89b8e247a405758d62bdd4e653cc33d9ced3a9702cb2e841bc486892bb7f3
6
+ metadata.gz: 6fc96e15be1592788c93b35888812c4a641397c9d27ff53610da4eecf20681f5a5ff359e8aad0761acfc4b15cc8ea4175513aee94dd6ff7a10c8a547b732b1d9
7
+ data.tar.gz: 72b143e12bd82f3f5283719103b075d28311115c9743f0774627d37d5ffb8c7350c97fca0fe71c6f61c2511939e50aeaf93cdb97b767aa04097f54740a9c0b56
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- restful-matchers (0.3.0)
4
+ restful-matchers (0.3.1)
5
5
  rspec (~> 2.0)
6
6
 
7
7
  GEM
@@ -22,7 +22,7 @@ GEM
22
22
  rspec-expectations (~> 2.14.0)
23
23
  rspec-mocks (~> 2.14.0)
24
24
  rspec-core (2.14.5)
25
- rspec-expectations (2.14.2)
25
+ rspec-expectations (2.14.3)
26
26
  diff-lcs (>= 1.1.3, < 2.0)
27
27
  rspec-mocks (2.14.3)
28
28
  slop (3.4.6)
@@ -13,10 +13,11 @@ module RESTful
13
13
  HaveLink.new(rel, href)
14
14
  end
15
15
  alias_method :have_restful_json_link, :have_link
16
+ alias_method :have_restful_link, :have_link
16
17
 
17
18
  class HaveLink
18
19
  def initialize(rel, href = nil)
19
- @rel = rel
20
+ @rel = rel.to_s
20
21
  @href = href
21
22
  end
22
23
 
@@ -17,6 +17,7 @@ module RESTful
17
17
  def have_links(links)
18
18
  HaveLinks.new(links)
19
19
  end
20
+ alias_method :have_restful_links, :have_links
20
21
 
21
22
  class HaveLinks
22
23
  def initialize(links)
@@ -1,5 +1,5 @@
1
1
  module RESTful
2
2
  module Matchers
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.3.1".freeze
4
4
  end
5
5
  end
@@ -6,6 +6,8 @@ describe RESTful::Matchers::HaveLink do
6
6
 
7
7
  it "should match a valid link" do
8
8
  @content.should have_link("self", "http://example.com")
9
+ @content.should have_restful_link("self", "http://example.com")
10
+ @content.should have_restful_json_link("self", "http://example.com")
9
11
  end
10
12
 
11
13
  it "should not match a non-existing link" do
@@ -6,11 +6,13 @@ describe RESTful::Matchers::HaveLinks do
6
6
  let(:content) { open("spec/fixtures/json/resource_with_links.json").read }
7
7
 
8
8
  it "should match an array of links using symbols as keys" do
9
- content.should have_links([
9
+ expected_links = [
10
10
  { rel: "self", href: "http://example.com" },
11
11
  { rel: "foo" , href: "http://example.com/foo" },
12
12
  { rel: "bar" , href: "http://example.com/bar" }
13
- ])
13
+ ]
14
+ content.should have_links(expected_links)
15
+ content.should have_restful_links(expected_links)
14
16
  end
15
17
 
16
18
  it "should match an array of links using string as keys" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful-matchers
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
  - Marcos Hack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.0.4
94
+ rubygems_version: 2.0.3
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: RSpec matchers to test RESTful HATEOAS-compliant resource links.