Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe KIR::Validation::AttachedDevicePrimaryIPCheck do
- before(:each) do
- @primary_ip = stub("PrimaryIpStub", :is_primary? => true)
- @ip = stub("IpStub", :is_primary? => false)
- @device1 = stub("DeviceStub1", :number => 9, :ip_addresses => [@primary_ip])
- @device2 = stub("DeviceStub2", :number => 20, :ip_addresses => [@ip])
- @environment = stub("NetworkEnvironmentStub", :number => "ENV1234", :network_devices => [@device1, @device2])
- end
- context "running" do
- context "when devices are missing their primary ip" do
- it "reports the the device_ids that are missing ips" do
- validation = KIR::Validation::AttachedDevicePrimaryIPCheck.new(@environment)
- validation.stubs(:attached_device_with_no_primary).returns([@device2])
- validation.run.should == ["the following attached devices are missing primary ip #{ ([@device2]).map(&:number).join(",")}"]
- end
- end
- context "when devices are not missing primary ip" do
- it "returns an empty set" do
- validation = KIR::Validation::AttachedDevicePrimaryIPCheck.new(@environment)
- validation.stubs(:attached_device_with_no_primary).returns([@device1])
- validation.run.should == nil
- end
- end
- end
- end
- getting this error :
- 'KIR::Validation::AttachedDevicePrimaryIPCheck running when devices are missing their primary ip reports the the device_ids that are missing ips' FAILED
- expected: ["the following attached devices are missing primary ip 20"],
- got: nil (using ==)
- ./spec/models/kir/validation/attached_device_primary_ip_check_spec.rb:20:
- /Users/mary5030/.rvm/gems/ruby-1.8.7-p174/bin/ruby_noexec_wrapper:14:
- one test failed
Advertisement
Add Comment
Please, Sign In to add comment