Sha256: 6ec238bdca2d7f4e402007bd62f478654453da2df415175d9c7978e321f1a40d

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

require 'spec_helper'
class FooResource < Infoblox::Resource
  remote_attr_accessor :name, :junction
  attr_accessor :animal
  wapi_object "foo:animal"
end

describe Infoblox::Resource, "#add_ipv4addr" do
  it "hashes correctly" do
    host = FooResource.new
    host._ref = "123"
    host.animal = "mom"
    host.name = "lol"
    hsh = host.send(:remote_attribute_hash)
    hsh.should eq({:name => 'lol', :junction => nil})
  end

  it "should have a correct resource_uri" do
    FooResource.resource_uri.should eq(Infoblox::BASE_PATH + "foo:animal")
    f=FooResource.new
    f.resource_uri.should eq(Infoblox::BASE_PATH + "foo:animal")
    f._ref = "lkjlkj"
    f.resource_uri.should eq(Infoblox::BASE_PATH + "lkjlkj")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
infoblox-0.0.4 spec/resource_spec.rb
infoblox-0.0.3 spec/resource_spec.rb
infoblox-0.0.2 spec/resource_spec.rb
infoblox-0.0.1 spec/resource_spec.rb