From 6a7687aa16d600350fe08b1622a49ad18f64bb86 Mon Sep 17 00:00:00 2001 From: prabhu-das Date: Mon, 2 Dec 2013 11:42:02 +0530 Subject: [PATCH 1/2] Unit test for custom_arguments passed. --- spec/unit/openstack_server_create_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/unit/openstack_server_create_spec.rb b/spec/unit/openstack_server_create_spec.rb index 5f72975f..c7cd0e87 100644 --- a/spec/unit/openstack_server_create_spec.rb +++ b/spec/unit/openstack_server_create_spec.rb @@ -13,10 +13,17 @@ it_behaves_like Chef::Knife::Cloud::ServerCreateCommand, Chef::Knife::Cloud::OpenstackServerCreate.new describe "#create_service_instance" do + before(:each) do + @instance = Chef::Knife::Cloud::OpenstackServerCreate.new + end + it "return OpenstackService instance" do - instance = Chef::Knife::Cloud::OpenstackServerCreate.new - expect(instance.create_service_instance).to be_an_instance_of(Chef::Knife::Cloud::OpenstackService) + expect(@instance.create_service_instance).to be_an_instance_of(Chef::Knife::Cloud::OpenstackService) end + + it "has custom_arguments as its option" do + expect(@instance.options.include? :custom_arguments).to be true + end end describe "#validate_params!" do From b2ebbb685b19576dabf861bb81a38f9561b6d39a Mon Sep 17 00:00:00 2001 From: prabhu-das Date: Mon, 9 Dec 2013 14:36:51 +0530 Subject: [PATCH 2/2] Updated the option name to :custom_attributes. --- spec/unit/openstack_server_create_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/openstack_server_create_spec.rb b/spec/unit/openstack_server_create_spec.rb index c7cd0e87..88ff1114 100644 --- a/spec/unit/openstack_server_create_spec.rb +++ b/spec/unit/openstack_server_create_spec.rb @@ -22,7 +22,7 @@ end it "has custom_arguments as its option" do - expect(@instance.options.include? :custom_arguments).to be true + expect(@instance.options.include? :custom_attributes).to be true end end