summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/dsl')
-rw-r--r--spec/unit/dsl/audit_spec.rb4
-rw-r--r--spec/unit/dsl/data_query_spec.rb4
-rw-r--r--spec/unit/dsl/platform_introspection_spec.rb26
-rw-r--r--spec/unit/dsl/reboot_pending_spec.rb14
-rw-r--r--spec/unit/dsl/recipe_spec.rb4
-rw-r--r--spec/unit/dsl/regsitry_helper_spec.rb12
-rw-r--r--spec/unit/dsl/resources_spec.rb20
7 files changed, 42 insertions, 42 deletions
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb
index 28b28e0a7c..df8dbc95c0 100644
--- a/spec/unit/dsl/audit_spec.rb
+++ b/spec/unit/dsl/audit_spec.rb
@@ -1,6 +1,6 @@
-require 'spec_helper'
-require 'chef/dsl/audit'
+require "spec_helper"
+require "chef/dsl/audit"
class AuditDSLTester < Chef::Recipe
include Chef::DSL::Audit
diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb
index 7bca47af3e..34d4cfdba3 100644
--- a/spec/unit/dsl/data_query_spec.rb
+++ b/spec/unit/dsl/data_query_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require 'spec_helper'
-require 'chef/dsl/data_query'
+require "spec_helper"
+require "chef/dsl/data_query"
class DataQueryDSLTester
include Chef::DSL::DataQuery
diff --git a/spec/unit/dsl/platform_introspection_spec.rb b/spec/unit/dsl/platform_introspection_spec.rb
index 438dde126e..61a7d8ca82 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
diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb
index 6705820e17..49696f7cc3 100644
--- a/spec/unit/dsl/reboot_pending_spec.rb
+++ b/spec/unit/dsl/reboot_pending_spec.rb
@@ -30,13 +30,13 @@ describe Chef::DSL::RebootPending do
context "platform is windows" do
before do
- allow(recipe).to receive(:platform?).with('windows').and_return(true)
+ allow(recipe).to receive(:platform?).with("windows").and_return(true)
allow(recipe).to receive(:registry_key_exists?).and_return(false)
allow(recipe).to receive(:registry_value_exists?).and_return(false)
end
it 'should return true if "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations" exists' do
- allow(recipe).to receive(:registry_value_exists?).with('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }).and_return(true)
+ allow(recipe).to receive(:registry_value_exists?).with('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => "PendingFileRenameOperations" }).and_return(true)
expect(recipe.reboot_pending?).to be_truthy
end
@@ -66,16 +66,16 @@ describe Chef::DSL::RebootPending do
context "platform is ubuntu" do
before do
- allow(recipe).to receive(:platform?).with('ubuntu').and_return(true)
+ allow(recipe).to receive(:platform?).with("ubuntu").and_return(true)
end
- it 'should return true if /var/run/reboot-required exists' do
- allow(File).to receive(:exists?).with('/var/run/reboot-required').and_return(true)
+ it "should return true if /var/run/reboot-required exists" do
+ allow(File).to receive(:exists?).with("/var/run/reboot-required").and_return(true)
expect(recipe.reboot_pending?).to be_truthy
end
- it 'should return false if /var/run/reboot-required does not exist' do
- allow(File).to receive(:exists?).with('/var/run/reboot-required').and_return(false)
+ it "should return false if /var/run/reboot-required does not exist" do
+ allow(File).to receive(:exists?).with("/var/run/reboot-required").and_return(false)
expect(recipe.reboot_pending?).to be_falsey
end
end
diff --git a/spec/unit/dsl/recipe_spec.rb b/spec/unit/dsl/recipe_spec.rb
index dfaad0b73e..108fe81d2b 100644
--- a/spec/unit/dsl/recipe_spec.rb
+++ b/spec/unit/dsl/recipe_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require 'spec_helper'
-require 'chef/dsl/recipe'
+require "spec_helper"
+require "chef/dsl/recipe"
RecipeDSLExampleClass = Struct.new(:cookbook_name, :recipe_name)
diff --git a/spec/unit/dsl/regsitry_helper_spec.rb b/spec/unit/dsl/regsitry_helper_spec.rb
index 6508a12b6f..8647b79020 100644
--- a/spec/unit/dsl/regsitry_helper_spec.rb
+++ b/spec/unit/dsl/regsitry_helper_spec.rb
@@ -33,22 +33,22 @@ describe Chef::Resource::RegistryKey do
context "tests registry dsl" do
it "resource can access registry_helper method registry_key_exists" do
- expect(@resource.respond_to?('registry_key_exists?')).to eq(true)
+ expect(@resource.respond_to?("registry_key_exists?")).to eq(true)
end
it "resource can access registry_helper method registry_get_values" do
- expect(@resource.respond_to?('registry_get_values')).to eq(true)
+ expect(@resource.respond_to?("registry_get_values")).to eq(true)
end
it "resource can access registry_helper method registry_has_subkey" do
- expect(@resource.respond_to?('registry_has_subkeys?')).to eq(true)
+ expect(@resource.respond_to?("registry_has_subkeys?")).to eq(true)
end
it "resource can access registry_helper method registry_get_subkeys" do
- expect(@resource.respond_to?('registry_get_subkeys')).to eq(true)
+ expect(@resource.respond_to?("registry_get_subkeys")).to eq(true)
end
it "resource can access registry_helper method registry_value_exists" do
- expect(@resource.respond_to?('registry_value_exists?')).to eq(true)
+ expect(@resource.respond_to?("registry_value_exists?")).to eq(true)
end
it "resource can access registry_helper method data_value_exists" do
- expect(@resource.respond_to?('registry_data_exists?')).to eq(true)
+ expect(@resource.respond_to?("registry_data_exists?")).to eq(true)
end
end
end
diff --git a/spec/unit/dsl/resources_spec.rb b/spec/unit/dsl/resources_spec.rb
index 581c835290..72ee23c8c9 100644
--- a/spec/unit/dsl/resources_spec.rb
+++ b/spec/unit/dsl/resources_spec.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require 'spec_helper'
-require 'chef/dsl/resources'
+require "spec_helper"
+require "chef/dsl/resources"
describe Chef::DSL::Resources do
let(:declared_resources) { [] }
@@ -36,21 +36,21 @@ describe Chef::DSL::Resources do
described_class.remove_resource_dsl(:test_resource)
end
- context 'with a resource added' do
+ context "with a resource added" do
before do
Chef::DSL::Resources.add_resource_dsl(:test_resource)
test_class.new.instance_eval do
- test_resource 'test_name' do
+ test_resource "test_name" do
end
end
end
- it { is_expected.to eq [[:test_resource, 'test_name']]}
+ it { is_expected.to eq [[:test_resource, "test_name"]]}
end
- context 'with no resource added' do
+ context "with no resource added" do
subject do
test_class.new.instance_eval do
- test_resource 'test_name' do
+ test_resource "test_name" do
end
end
end
@@ -58,14 +58,14 @@ describe Chef::DSL::Resources do
it { expect { subject }.to raise_error NoMethodError }
end
- context 'with a resource added and removed' do
+ context "with a resource added and removed" do
before do
Chef::DSL::Resources.add_resource_dsl(:test_resource)
Chef::DSL::Resources.remove_resource_dsl(:test_resource)
end
subject do
test_class.new.instance_eval do
- test_resource 'test_name' do
+ test_resource "test_name" do
end
end
end
@@ -73,7 +73,7 @@ describe Chef::DSL::Resources do
it { expect { subject }.to raise_error NoMethodError }
end
- context 'with a nameless resource' do
+ context "with a nameless resource" do
before do
Chef::DSL::Resources.add_resource_dsl(:test_resource)
test_class.new.instance_eval do