shutl_resource 1.7.3 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shutl/resource/rest_class_methods.rb +1 -1
- data/lib/shutl/resource/version.rb +1 -1
- data/spec/rest_resource_spec.rb +14 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4e6e89f181b62bd4c7d217a7f303f6f0a573607
|
4
|
+
data.tar.gz: befdafe23b0daf80bc0d393094babfca05ded320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 120c5ca58f3a0b3caa7ddd3898f8ae5d018127dc64adee99e3411fc6ad25c3465d301447ab25f7ec0c8b88d37d3acd3791440d8b576ebd6932599128f800bd83
|
7
|
+
data.tar.gz: b9c40de77edc47756c0e10f97435cfab8d530b5435426bcf72a655e7736fd9e945057b8ec5c3dfc75c185a4354c1c6f1f1d6fbcfea241d508dedbf7c29698174
|
data/spec/rest_resource_spec.rb
CHANGED
@@ -568,13 +568,18 @@ describe Shutl::Resource::Rest do
|
|
568
568
|
request.should have_been_requested
|
569
569
|
end
|
570
570
|
|
571
|
-
|
572
571
|
it 'should raise an error if the update is called with the ! and it fails' do
|
573
572
|
stub_request(:put, 'http://host/test_rests/a').
|
574
573
|
to_return(status: 400)
|
575
574
|
|
576
575
|
expect(-> { resource.save }).to raise_error(Shutl::BadRequest)
|
577
576
|
end
|
577
|
+
|
578
|
+
it 'should allow method to be overridden via options' do
|
579
|
+
request = stub_request(:post, 'http://host/test_rests/a')
|
580
|
+
resource.save({"method" => :post})
|
581
|
+
end
|
582
|
+
|
578
583
|
end
|
579
584
|
|
580
585
|
describe '#update!' do
|
@@ -646,15 +651,15 @@ describe Shutl::Resource::Rest do
|
|
646
651
|
end
|
647
652
|
end
|
648
653
|
|
649
|
-
|
650
|
-
|
654
|
+
describe '#respond_to?' do
|
655
|
+
subject { TestRest.new a:1, b:2 }
|
651
656
|
|
652
|
-
|
653
|
-
|
654
|
-
|
657
|
+
it 'responds to a getter if it has an attribute' do
|
658
|
+
subject.respond_to?(:a).should be_true
|
659
|
+
end
|
655
660
|
|
656
|
-
|
657
|
-
|
658
|
-
end
|
661
|
+
it 'does not responsd to a getter if there is no attributes' do
|
662
|
+
subject.respond_to?(:foo).should be_false
|
659
663
|
end
|
664
|
+
end
|
660
665
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shutl_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rouchy
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: shutl_auth
|