shutl_resource 1.7.3 → 1.8.0

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: 96b124ecad27867670f5f3df5f9d62edb1201575
4
- data.tar.gz: 3d9f2c4b25b86d114b9d550e23dc09e4ac5bd608
3
+ metadata.gz: d4e6e89f181b62bd4c7d217a7f303f6f0a573607
4
+ data.tar.gz: befdafe23b0daf80bc0d393094babfca05ded320
5
5
  SHA512:
6
- metadata.gz: 272172bd6f2547034e3feef331a5d9711e93e88b0d2244c310e40c452ed26f0fa80d940a93ca963a03686436b0883290e61386f439ac0838b1b40dfcd4c1f2f5
7
- data.tar.gz: 2adc0178107734fc3f42022d8f3babf562b5c84e01f277e9f3ecaa85709d6cec75372f43d4eaa08a69e21e38e008798454231d605bad789dddeca9a609a3b15a
6
+ metadata.gz: 120c5ca58f3a0b3caa7ddd3898f8ae5d018127dc64adee99e3411fc6ad25c3465d301447ab25f7ec0c8b88d37d3acd3791440d8b576ebd6932599128f800bd83
7
+ data.tar.gz: b9c40de77edc47756c0e10f97435cfab8d530b5435426bcf72a655e7736fd9e945057b8ec5c3dfc75c185a4354c1c6f1f1d6fbcfea241d508dedbf7c29698174
@@ -81,7 +81,7 @@ module Shutl::Resource
81
81
  body = { @resource_name => convert_new_id(attributes) }.to_json
82
82
 
83
83
  response = perform_action(instance,
84
- :put,
84
+ options.fetch("method", :put),
85
85
  body,
86
86
  generate_request_header(header_options(options)),
87
87
  "Save failed")
@@ -1,5 +1,5 @@
1
1
  module Shutl
2
2
  module Resource
3
- VERSION = '1.7.3'
3
+ VERSION = '1.8.0'
4
4
  end
5
5
  end
@@ -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
- describe '#respond_to?' do
650
- subject { TestRest.new a:1, b:2 }
654
+ describe '#respond_to?' do
655
+ subject { TestRest.new a:1, b:2 }
651
656
 
652
- it 'responds to a getter if it has an attribute' do
653
- subject.respond_to?(:a).should be_true
654
- end
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
- it 'does not responsd to a getter if there is no attributes' do
657
- subject.respond_to?(:foo).should be_false
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.7.3
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: 2014-12-01 00:00:00.000000000 Z
16
+ date: 2015-09-11 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: shutl_auth