dnsimple-ruby 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. data/Gemfile +3 -1
  2. data/Gemfile.lock +4 -0
  3. data/VERSION +1 -1
  4. data/fixtures/vcr_cassettes/DNSimple_Contact/a_new_contact.yml +44 -0
  5. data/fixtures/vcr_cassettes/DNSimple_Contact/an_existing_contact.yml +44 -0
  6. data/fixtures/vcr_cassettes/DNSimple_Domain/_all.yml +181 -0
  7. data/fixtures/vcr_cassettes/DNSimple_Domain/applying_templates.yml +316 -0
  8. data/fixtures/vcr_cassettes/DNSimple_Domain/creating_a_new_domain.yml +46 -0
  9. data/fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain.yml +46 -0
  10. data/fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_id.yml +46 -0
  11. data/fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_name.yml +46 -0
  12. data/fixtures/vcr_cassettes/DNSimple_Domain/registration/with_a_new_registrant_contact.yml +46 -0
  13. data/fixtures/vcr_cassettes/DNSimple_Domain/registration/with_an_existing_contact.yml +46 -0
  14. data/fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_ca.yml +42 -0
  15. data/fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_com.yml +42 -0
  16. data/fixtures/vcr_cassettes/DNSimple_Record/_all.yml +361 -0
  17. data/fixtures/vcr_cassettes/DNSimple_Record/creating_a_new_record.yml +91 -0
  18. data/fixtures/vcr_cassettes/DNSimple_Record/find_a_record.yml +91 -0
  19. data/fixtures/vcr_cassettes/DNSimple_Template/a_template.yml +46 -0
  20. data/fixtures/vcr_cassettes/DNSimple_User/_me.yml +44 -0
  21. data/lib/dnsimple/extended_attribute.rb +0 -1
  22. data/spec/contact_spec.rb +12 -9
  23. data/spec/domain_spec.rb +46 -47
  24. data/spec/extended_attributes_spec.rb +2 -0
  25. data/spec/record_spec.rb +14 -20
  26. data/spec/spec_helper.rb +10 -0
  27. data/spec/template_spec.rb +1 -0
  28. data/spec/user_spec.rb +1 -0
  29. metadata +50 -5
@@ -4,11 +4,13 @@ describe DNSimple::ExtendedAttribute do
4
4
 
5
5
  describe "list extended attributes" do
6
6
  context "for com" do
7
+ use_vcr_cassette
7
8
  it "is an empty array" do
8
9
  DNSimple::ExtendedAttribute.find('com').should be_empty
9
10
  end
10
11
  end
11
12
  context "for ca" do
13
+ use_vcr_cassette
12
14
  it "is not empty" do
13
15
  DNSimple::ExtendedAttribute.find('ca').should_not be_empty
14
16
  end
data/spec/record_spec.rb CHANGED
@@ -1,28 +1,21 @@
1
1
  require File.join(File.dirname(__FILE__), 'spec_helper')
2
2
 
3
3
  describe DNSimple::Record do
4
- before do
5
- @domain = DNSimple::Domain.create("testdomain.com")
6
- end
7
-
8
- after do
9
- @domain.delete
10
- end
11
-
12
- describe "a new record" do
13
- before do
14
- @record = DNSimple::Record.create(@domain.name, "", "A", "1.2.3.4", :ttl => 600)
15
- end
16
-
4
+ describe "creating a new record" do
5
+ use_vcr_cassette
17
6
  it "has specific attributes" do
18
- @record.name.should eql("")
19
- @record.record_type.should eql("A")
20
- @record.content.should eql("1.2.3.4")
21
- @record.ttl.should eql(600)
22
- @record.id.should_not be_nil
7
+ record = DNSimple::Record.create('testdomain.com', "", "A", "1.2.3.4", :ttl => 600)
8
+ record.name.should eql("")
9
+ record.record_type.should eql("A")
10
+ record.content.should eql("1.2.3.4")
11
+ record.ttl.should eql(600)
12
+ record.id.should_not be_nil
23
13
  end
14
+ end
15
+ describe "find a record" do
16
+ use_vcr_cassette
24
17
  it "can be found by id" do
25
- record = DNSimple::Record.find(@domain.name, @record.id)
18
+ record = DNSimple::Record.find('testdomain.com', 193)
26
19
  record.name.should eql("")
27
20
  record.record_type.should eql("A")
28
21
  record.content.should eql("1.2.3.4")
@@ -32,6 +25,7 @@ describe DNSimple::Record do
32
25
  end
33
26
 
34
27
  describe ".all" do
28
+ use_vcr_cassette
35
29
  before do
36
30
  @records = []
37
31
 
@@ -41,7 +35,7 @@ describe DNSimple::Record do
41
35
  end
42
36
 
43
37
  it "returns a list of records" do
44
- records = DNSimple::Record.all(@domain.name)
38
+ records = DNSimple::Record.all('testdomain.com')
45
39
  records.should_not be_empty
46
40
  records.length.should eql(@records.length)
47
41
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,15 @@
1
+ require 'vcr'
1
2
  require 'lib/dnsimple'
2
3
 
4
+ VCR.config do |c|
5
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
6
+ c.stub_with :fakeweb
7
+ end
8
+
9
+ RSpec.configure do |c|
10
+ c.extend VCR::RSpec::Macros
11
+ end
12
+
3
13
  config = YAML.load(File.new(File.expand_path('~/.dnsimple.test')))
4
14
 
5
15
  DNSimple::Client.base_uri = config['site'] || "https://test.dnsimple.com/"
@@ -2,6 +2,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
2
2
 
3
3
  describe DNSimple::Template do
4
4
  describe "a template" do
5
+ use_vcr_cassette
5
6
  it "can be found by name" do
6
7
  template = DNSimple::Template.find('googleapps')
7
8
  template.id.should_not be_nil
data/spec/user_spec.rb CHANGED
@@ -2,6 +2,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
2
2
 
3
3
  describe DNSimple::User do
4
4
  describe ".me" do
5
+ use_vcr_cassette
5
6
  before do
6
7
  @user = DNSimple::User.me
7
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsimple-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 8
10
- version: 0.9.8
9
+ - 9
10
+ version: 0.9.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anthony Eden
@@ -133,9 +133,9 @@ dependencies:
133
133
  version: "0"
134
134
  requirement: *id008
135
135
  - !ruby/object:Gem::Dependency
136
- type: :runtime
136
+ type: :development
137
137
  prerelease: false
138
- name: httparty
138
+ name: fakeweb
139
139
  version_requirements: &id009 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
@@ -146,6 +146,34 @@ dependencies:
146
146
  - 0
147
147
  version: "0"
148
148
  requirement: *id009
149
+ - !ruby/object:Gem::Dependency
150
+ type: :development
151
+ prerelease: false
152
+ name: vcr
153
+ version_requirements: &id010 !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ hash: 3
159
+ segments:
160
+ - 0
161
+ version: "0"
162
+ requirement: *id010
163
+ - !ruby/object:Gem::Dependency
164
+ type: :runtime
165
+ prerelease: false
166
+ name: httparty
167
+ version_requirements: &id011 !ruby/object:Gem::Requirement
168
+ none: false
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ hash: 3
173
+ segments:
174
+ - 0
175
+ version: "0"
176
+ requirement: *id011
149
177
  description: A ruby wrapper for the DNSimple API that also includes a command-line client.
150
178
  email: anthony.eden@dnsimple.com
151
179
  executables:
@@ -188,6 +216,23 @@ files:
188
216
  - features/step_definitions/record_steps.rb
189
217
  - features/step_definitions/template_steps.rb
190
218
  - features/support/env.rb
219
+ - fixtures/vcr_cassettes/DNSimple_Contact/a_new_contact.yml
220
+ - fixtures/vcr_cassettes/DNSimple_Contact/an_existing_contact.yml
221
+ - fixtures/vcr_cassettes/DNSimple_Domain/_all.yml
222
+ - fixtures/vcr_cassettes/DNSimple_Domain/applying_templates.yml
223
+ - fixtures/vcr_cassettes/DNSimple_Domain/creating_a_new_domain.yml
224
+ - fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain.yml
225
+ - fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_id.yml
226
+ - fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_name.yml
227
+ - fixtures/vcr_cassettes/DNSimple_Domain/registration/with_a_new_registrant_contact.yml
228
+ - fixtures/vcr_cassettes/DNSimple_Domain/registration/with_an_existing_contact.yml
229
+ - fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_ca.yml
230
+ - fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_com.yml
231
+ - fixtures/vcr_cassettes/DNSimple_Record/_all.yml
232
+ - fixtures/vcr_cassettes/DNSimple_Record/creating_a_new_record.yml
233
+ - fixtures/vcr_cassettes/DNSimple_Record/find_a_record.yml
234
+ - fixtures/vcr_cassettes/DNSimple_Template/a_template.yml
235
+ - fixtures/vcr_cassettes/DNSimple_User/_me.yml
191
236
  - lib/dnsimple.rb
192
237
  - lib/dnsimple/certificate.rb
193
238
  - lib/dnsimple/cli.rb