1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

WIP: add stub model classes

This commit is contained in:
Michael Hale 2011-06-16 14:51:13 -07:00 committed by geemus
parent 8354d3c043
commit fdb90eda30
7 changed files with 130 additions and 5 deletions

View file

@ -50,6 +50,7 @@ namespace :test do
task :dynect do
[false, true].each do |mock|
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/requests/dynect")
sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/dns/models/")
end
end
end

View file

@ -6,11 +6,11 @@ module Fog
recognizes :timeout, :persistent
recognizes :provider # remove post deprecation
# model_path 'fog/dns/models/dynect'
# model :record
# collection :records
# model :zone
# collection :zones
model_path 'fog/dns/models/dynect'
model :record
collection :records
model :zone
collection :zones
request_path 'fog/dns/requests/dynect'
request :session

View file

@ -0,0 +1,38 @@
require 'fog/core/model'
module Fog
module Dynect
class DNS
class Record < Fog::Model
extend Fog::Deprecation
deprecate :ip, :value
deprecate :ip=, :value=
identity :id
attribute :name
attribute :value, :aliases => "content"
attribute :ttl
attribute :created_at
attribute :updated_at
attribute :zone_id, :aliases => "domain_id"
attribute :type, :aliases => "record_type"
attribute :priority, :aliases => "prio"
def initialize(attributes={})
end
def destroy
end
def zone
end
def save
end
end
end
end
end

View file

@ -0,0 +1,27 @@
require 'fog/core/collection'
require 'fog/dns/models/dynect/record'
module Fog
module Dynect
class DNS
class Records < Fog::Collection
attribute :zone
model Fog::Dynect::DNS::Record
def all
end
def get(record_id)
end
def new(attributes = {})
end
end
end
end
end

View file

@ -0,0 +1,32 @@
require 'fog/core/model'
require 'fog/dns/models/dynect/records'
module Fog
module Dynect
class DNS
class Zone < Fog::Model
identity :id
attribute :domain, :aliases => 'name'
attribute :created_at
attribute :updated_at
def destroy
end
def records
end
def nameservers
end
def save
end
end
end
end
end

View file

@ -0,0 +1,22 @@
require 'fog/core/collection'
require 'fog/dns/models/dynect/zone'
module Fog
module Dynect
class DNS
class Zones < Fog::Collection
model Fog::Dynect::DNS::Zone
def all
end
def get(zone_id)
end
end
end
end
end

View file

@ -12,5 +12,10 @@ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do
returns(true) { response.body['zones'].first =~ /\.com/ && true }
returns(true) { response.status == 200 }
end
tests "create record"
tests "delete record"
tests "update record"
tests "list jobs"
end
end