Sha256: 3cd7f7043cd94aef7c421be1cde204451269071682a5ef320b0277ecd6e58938

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Tiktalik::Computing::VPSNetInterface do

  context "instance" do
    let(:subject) { Tiktalik::Computing::VPSNetInterface.new(VPSNETINTERFACE_STUB)}

    its(:uuid) { should eql("b5a097ee-a095-47b4-b7c7-4b11100559a7") }
    its(:mac) { should eql("e6:95:e5:4c:99:86") }
    its(:ip) { should eql("37.233.98.178") }
    its(:seq ) { should eql(0) }

    it "should have network" do
      subject.network.class.should eql(Tiktalik::Computing::Network)
      subject.network.uuid.should eql("e92e60c2-2993-4a0c-b635-c5e2b2462c7a")
    end

    context "#destroy" do
      let(:url) { "/api/v1/computing/instance/#{INSTANCE_STUB["uuid"]}/interface/#{subject.uuid}" }
      let(:method) { :delete }
      let(:request) { subject.method(:destroy) }

      it "should return true" do
        $faraday_stubs.send(method, url) { [ 200, {}, '' ] }
        request.call.should eql(true)
        $faraday_stubs.verify_stubbed_calls
      end

      it_should_behave_like 'support error 401'
      it_should_behave_like 'support error 404'
      it_should_behave_like 'support error 405'
      it_should_behave_like 'support error 500'
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tiktalik-1.0.5 spec/computing/vpsnetinterface_spec.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/tiktalik-1.0.4/spec/computing/vpsnetinterface_spec.rb
tiktalik-1.0.4 spec/computing/vpsnetinterface_spec.rb
tiktalik-1.0.3 spec/computing/vpsnetinterface_spec.rb
tiktalik-1.0.1 spec/computing/vpsnetinterface_spec.rb