Sha256: e1e1fd1ed146c663a647511fd23c19695b1d0ac9495a5888471d4c3bce9972a3

Contents?: true

Size: 1.09 KB

Versions: 28

Compression:

Stored size: 1.09 KB

Contents

require File.expand_path '../../test_helper', __dir__

# Test class for Zone Model
class TestZone < Minitest::Test
  def setup
    @service = Fog::DNS::AzureRM.new(credentials)
    @zone = zone(@service)
    @dns_client1 = @service.instance_variable_get(:@dns_client)
    @response = ApiStub::Models::DNS::Zone.create_zone_obj(@dns_client1)
  end

  def test_model_methods
    methods = [
      :save,
      :destroy
    ]
    methods.each do |method|
      assert_respond_to @zone, method
    end
  end

  def test_model_attributes
    attributes = [
      :name,
      :id,
      :resource_group,
      :tags
    ]
    attributes.each do |attribute|
      assert_respond_to @zone, attribute
    end
  end

  def test_save_method_response
    @service.stub :create_or_update_zone, @response do
      assert_instance_of Fog::DNS::AzureRM::Zone, @zone.save
    end
  end

  def test_destroy_method_true_response
    @service.stub :delete_zone, true do
      assert @zone.destroy
    end
  end

  def test_destroy_method_false_response
    @service.stub :delete_zone, false do
      assert !@zone.destroy
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 test/models/dns/test_zone.rb
fog-azure-rm-0.5.3 test/models/dns/test_zone.rb
fog-azure-rm-0.5.2 test/models/dns/test_zone.rb
far-gem-0.5.6 test/models/dns/test_zone.rb
fog-azure-rm-0.5.1 test/models/dns/test_zone.rb
far-gem-0.5.5 test/models/dns/test_zone.rb
fog-azure-rm-0.5.0 test/models/dns/test_zone.rb
far-gem-0.5.4 test/models/dns/test_zone.rb
far-gem-0.5.3 test/models/dns/test_zone.rb
fog-azure-rm-0.4.9 test/models/dns/test_zone.rb
far-gem-0.5.2 test/models/dns/test_zone.rb
fog-azure-rm-0.4.8 test/models/dns/test_zone.rb
fog-azure-rm-0.4.7 test/models/dns/test_zone.rb
fog-azure-rm-0.4.6 test/models/dns/test_zone.rb
fog-azure-rm-0.4.5 test/models/dns/test_zone.rb
fog-azure-rm-temp-0.0.5 test/models/dns/test_zone.rb
fog-azure-rm-0.4.4 test/models/dns/test_zone.rb
fog-azure-rm-0.4.3 test/models/dns/test_zone.rb
far-gem-0.5.1 test/models/dns/test_zone.rb
fog-azure-rm-0.4.2 test/models/dns/test_zone.rb