diff options
Diffstat (limited to 'spec/unit/dsl/platform_introspection_spec.rb')
-rw-r--r-- | spec/unit/dsl/platform_introspection_spec.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/dsl/platform_introspection_spec.rb b/spec/unit/dsl/platform_introspection_spec.rb index e41560c034..d2dcb36615 100644 --- a/spec/unit/dsl/platform_introspection_spec.rb +++ b/spec/unit/dsl/platform_introspection_spec.rb @@ -16,8 +16,8 @@ # limitations under the License. # -require 'spec_helper' -require 'chef/dsl/platform_introspection' +require "spec_helper" +require "chef/dsl/platform_introspection" class LanguageTester attr_reader :node @@ -39,16 +39,16 @@ end describe Chef::DSL::PlatformIntrospection::PlatformDependentValue do before do platform_hash = { - :openbsd => {:default => 'free, functional, secure'}, + :openbsd => {:default => "free, functional, secure"}, [:redhat, :centos, :fedora, :scientific] => {:default => '"stable"'}, - :ubuntu => {'10.04' => 'using upstart more', :default => 'using init more'}, - :default => 'bork da bork' + :ubuntu => {"10.04" => "using upstart more", :default => "using init more"}, + :default => "bork da bork" } @platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformDependentValue.new(platform_hash) end it "returns the default value when the platform doesn't match" do - expect(@platform_specific_value.value_for_node(:platform => :dos)).to eq('bork da bork') + expect(@platform_specific_value.value_for_node(:platform => :dos)).to eq("bork da bork") end it "returns a value for a platform set as a group" do @@ -60,20 +60,20 @@ describe Chef::DSL::PlatformIntrospection::PlatformDependentValue do end it "returns a value for a specific platform version" do - node = {:platform => 'ubuntu', :platform_version => '10.04'} - expect(@platform_specific_value.value_for_node(node)).to eq('using upstart more') + node = {:platform => "ubuntu", :platform_version => "10.04"} + expect(@platform_specific_value.value_for_node(node)).to eq("using upstart more") end it "returns a platform-default value if the platform version doesn't match an explicit one" do - node = {:platform => 'ubuntu', :platform_version => '9.10' } - expect(@platform_specific_value.value_for_node(node)).to eq('using init more') + node = {:platform => "ubuntu", :platform_version => "9.10" } + expect(@platform_specific_value.value_for_node(node)).to eq("using init more") end it "returns nil if there is no default and no platforms match" do # this matches the behavior in the original implementation. # whether or not it's correct is another matter. platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformDependentValue.new({}) - expect(platform_specific_value.value_for_node(:platform => 'foo')).to be_nil + expect(platform_specific_value.value_for_node(:platform => "foo")).to be_nil end it "raises an argument error if the platform hash is not correctly structured" do @@ -98,7 +98,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue do end it "returns the default value when the platform family doesn't match" do - expect(@platform_family_value.value_for_node(:platform_family => :os2)).to eq('default value') + expect(@platform_family_value.value_for_node(:platform_family => :os2)).to eq("default value") end @@ -124,7 +124,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue do it "returns nil if there is no default and no platforms match" do platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue.new({}) - expect(platform_specific_value.value_for_node(:platform_family => 'foo')).to be_nil + expect(platform_specific_value.value_for_node(:platform_family => "foo")).to be_nil end end |