splicer-dns_made_easy 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,7 +83,7 @@ module Splicer
83
83
  def execute(args={})
84
84
  RestClient::Request.execute(args)
85
85
  rescue RestClient::Exception => error
86
- raise Splicer::Errors::Error.new(error)
86
+ raise Splicer::Errors::RequestError.new(error)
87
87
  end
88
88
 
89
89
  # Processes the payload to see if it needs to be turned in to JSON
@@ -1,5 +1,5 @@
1
1
  module Splicer
2
2
  module DnsMadeEasy
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -0,0 +1,75 @@
1
+ require 'spec_helper'
2
+
3
+ describe Splicer::DnsMadeEasy::Client do
4
+ let(:client) { Splicer::DnsMadeEasy::Client.new('key','secret') }
5
+ describe '#initialize' do
6
+ it "should initialize" do
7
+ expect(client).to be_a(Splicer::DnsMadeEasy::Client)
8
+ end
9
+ end
10
+
11
+ describe '#post' do
12
+ subject { client.post('resource', { data: 'something' }) }
13
+
14
+ context 'when Dynect returns with success' do
15
+ before { client.stub(:execute).and_return({}) }
16
+ it { should eq({})}
17
+ end
18
+
19
+ context 'when Dynect returns with an error' do
20
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
21
+ it 'should raise a Splicer::Errors::RequestError' do
22
+ expect { subject }.to raise_error(Splicer::Errors::RequestError)
23
+ end
24
+ end
25
+ end
26
+
27
+ describe '#get' do
28
+ subject { client.get('resource') }
29
+
30
+ context 'when Dynect returns with success' do
31
+ before { client.stub(:execute).and_return({}) }
32
+ it { should eq({})}
33
+ end
34
+
35
+ context 'when Dynect returns with an error' do
36
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
37
+ it 'should raise a Splicer::Errors::RequestError' do
38
+ expect { subject }.to raise_error(Splicer::Errors::RequestError)
39
+ end
40
+ end
41
+ end
42
+
43
+ describe '#put' do
44
+ subject { client.put('resource', { data: 'something' }) }
45
+
46
+ context 'when Dynect returns with success' do
47
+ before { client.stub(:execute).and_return({}) }
48
+ it { should eq({})}
49
+ end
50
+
51
+ context 'when Dynect returns with an error' do
52
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
53
+ it 'should raise a Splicer::Errors::RequestError' do
54
+ expect { subject }.to raise_error(Splicer::Errors::RequestError)
55
+ end
56
+ end
57
+ end
58
+
59
+ describe '#delete' do
60
+ subject { client.delete('resource') }
61
+
62
+ context 'when Dynect returns with success' do
63
+ before { client.stub(:execute).and_return({}) }
64
+ it { should eq({})}
65
+ end
66
+
67
+ context 'when Dynect returns with an error' do
68
+ before { client.stub(:execute).and_raise(Splicer::Errors::RequestError) }
69
+ it 'should raise a Splicer::Errors::RequestError' do
70
+ expect { subject }.to raise_error(Splicer::Errors::RequestError)
71
+ end
72
+ end
73
+ end
74
+
75
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splicer-dns_made_easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -113,6 +113,7 @@ files:
113
113
  - lib/splicer/dns_made_easy/time.rb
114
114
  - lib/splicer/dns_made_easy/version.rb
115
115
  - spec/spec_helper.rb
116
+ - spec/splicer/dns_made_easy/client_spec.rb
116
117
  - spec/splicer/dns_made_easy/config_spec.rb
117
118
  - splicer-dns_made_easy.gemspec
118
119
  homepage: https://github.com/zippykid/dns_made_easy
@@ -130,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
131
  version: '0'
131
132
  segments:
132
133
  - 0
133
- hash: -1356569842571179341
134
+ hash: 4133550921617049631
134
135
  required_rubygems_version: !ruby/object:Gem::Requirement
135
136
  none: false
136
137
  requirements:
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  version: '0'
140
141
  segments:
141
142
  - 0
142
- hash: -1356569842571179341
143
+ hash: 4133550921617049631
143
144
  requirements: []
144
145
  rubyforge_project:
145
146
  rubygems_version: 1.8.25
@@ -148,4 +149,5 @@ specification_version: 3
148
149
  summary: The splicer adapter for interacting DnsMadeEasy
149
150
  test_files:
150
151
  - spec/spec_helper.rb
152
+ - spec/splicer/dns_made_easy/client_spec.rb
151
153
  - spec/splicer/dns_made_easy/config_spec.rb