spark_api 1.4.19 → 1.4.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjBhNTg3Y2Q0ZWY3NzUzZDI3ZjViNjNkZjY3NGQ2YmU1ZTIwODE4Mw==
4
+ Y2FhNTc3MjdmODk2Y2VkZmIwYzQxMjA0MTk4NjdmNGExZGM0MThlOQ==
5
5
  data.tar.gz: !binary |-
6
- ZjkwOTRhZGVhYjkzZmFjYjkwOGYzMDkzYzI2M2VkYWQwNzJjY2VhZg==
6
+ OWRiNzkwY2QzNTM5ODM1OWRhOTZmZDZhOTMxNTFjY2U4YmM3ZTc3YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWIzZTkzZGJmZDcwNzg1YmY4ZTY4NTcyZDViOWZjNTgzYzZhNjNlZmFiZmQw
10
- NWZhZGUwZTc1YTA5NDljOTc3NzVkM2UwZTcwMjQ1Y2MyMThmN2E4ZTU4NjVh
11
- ZTc1YTMyZTNlZTUzNzRiNmJiY2Q0YTA4YjRhZmNlNWE0NDA2MzM=
9
+ NWIzYmFmMmNiM2E2NmY1NWRkZTI0MTE1Nzg1OWMwNzcwNjg5ZjU3N2I2Mzlm
10
+ ZmE5MzE0ODdhYzJjYzQ2M2I4NTkwNDU4ZDVhYzI0NzA5NTEzZjRjMmM2MTc4
11
+ YWFjZWNhY2RmMzlmZjJjYzQyOTI4MWM3MTM3ZmU4ODIzNDVjNTQ=
12
12
  data.tar.gz: !binary |-
13
- ZDI2YzIxZTU1NjlhMDBmN2U2NTgwYWEwNDFhZGI5NWE2MjI0NzYxZjJhODJj
14
- YjQzOWExZjFiMDU2ODE5YWU1NWQ3OGZjY2RlZjM0MmM3OTc4ZjAzNmQ3NTRi
15
- YzYxYzI2OTAwZmY2YTk0YzM0NjM1MTZkYTMzOTE4OWFlOGRhMTY=
13
+ NGIyOTNiYmJiMGYzMGI4ODNkNDcyYzcxZDk0YmI3NjZkNWYwZGM2ZjJlODRm
14
+ Y2IwNzY5MjlmODc5YzFmMWE4YWIwMDJmNjEwZTE4MzYzZWQ5MDg3MTAzNWM1
15
+ YzczM2NkMTlhZDAwYWUzNmU5OWVhYjEyZGY0Mjk3ODBmMDNiYzA=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.19
1
+ 1.4.20
@@ -4,6 +4,19 @@ module SparkApi
4
4
 
5
5
  module Destroyable
6
6
 
7
+ def self.included(base)
8
+ base.extend(ClassMethods)
9
+ end
10
+
11
+ module ClassMethods
12
+
13
+ def destroy(id, arguments = {})
14
+ connection.delete("#{path}/#{id}", arguments)
15
+ end
16
+
17
+ end
18
+
19
+
7
20
  def destroy(arguments = {})
8
21
  self.errors = []
9
22
  begin
@@ -14,15 +14,32 @@ describe Concerns::Destroyable, "Destroyable Concern" do
14
14
  @model = MyExampleModel.first
15
15
  end
16
16
 
17
- it "should not be destroyed" do
18
- @model.destroyed?.should eq(false)
17
+ describe 'destroyed?' do
18
+
19
+ it "should not be destroyed" do
20
+ @model.destroyed?.should eq(false)
21
+ end
19
22
  end
20
23
 
21
- it "should be destroyable" do
22
- stub_api_delete("/some/place/20101230223226074201000000")
23
- @model = MyExampleModel.first
24
- @model.destroy
25
- @model.destroyed?.should eq(true)
24
+ describe 'destroy' do
25
+
26
+ it "should be destroyable" do
27
+ stub_api_delete("/some/place/20101230223226074201000000")
28
+ @model = MyExampleModel.first
29
+ @model.destroy
30
+ @model.destroyed?.should eq(true)
31
+ end
32
+
33
+ end
34
+
35
+ describe 'destroy class method' do
36
+
37
+ it "allows you to destroy with only the id" do
38
+ stub_api_delete("/test/example/20101230223226074201000000")
39
+ MyExampleModel.destroy('20101230223226074201000000')
40
+ expect_api_request(:delete, "/test/example/20101230223226074201000000").to have_been_made.once
41
+ end
42
+
26
43
  end
27
44
 
28
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.19
4
+ version: 1.4.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hornseth
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-01 00:00:00.000000000 Z
12
+ date: 2018-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday