summaryrefslogtreecommitdiff
path: root/spec/unit/facter
diff options
context:
space:
mode:
authorMorgan Haskel <morgan@puppetlabs.com>2014-06-05 16:16:34 -0400
committerMorgan Haskel <morgan@puppetlabs.com>2014-06-05 16:16:34 -0400
commitffe21fc67491c4502114505c82142781d72720ab (patch)
tree7f0ee09079863a19f07e0bb999e387eedb32e17e /spec/unit/facter
parentf9f6e92dffa8364cfbbd92a6a65f4be4ef176d2c (diff)
parent6287a200af558d277f83b919e8409f6c798eef39 (diff)
Merge pull request #268 from apenney/rspec3
Rspec3 changes
Diffstat (limited to 'spec/unit/facter')
-rwxr-xr-xspec/unit/facter/facter_dot_d_spec.rb4
-rwxr-xr-xspec/unit/facter/pe_version_spec.rb20
-rwxr-xr-xspec/unit/facter/root_home_spec.rb8
-rwxr-xr-xspec/unit/facter/util/puppet_settings_spec.rb6
4 files changed, 19 insertions, 19 deletions
diff --git a/spec/unit/facter/facter_dot_d_spec.rb b/spec/unit/facter/facter_dot_d_spec.rb
index 2fb72b2..0afadb2 100755
--- a/spec/unit/facter/facter_dot_d_spec.rb
+++ b/spec/unit/facter/facter_dot_d_spec.rb
@@ -13,7 +13,7 @@ describe Facter::Util::DotD do
end
it 'should return successfully' do
- Facter.fact(:fake_fact).value.should == 'fake fact'
+ expect(Facter.fact(:fake_fact).value).to eq('fake fact')
end
end
@@ -26,7 +26,7 @@ describe Facter::Util::DotD do
end
it 'should return successfully' do
- Facter.fact(:foo).value.should == '1+1=2'
+ expect(Facter.fact(:foo).value).to eq('1+1=2')
end
end
end
diff --git a/spec/unit/facter/pe_version_spec.rb b/spec/unit/facter/pe_version_spec.rb
index 931c6d4..4d0349e 100755
--- a/spec/unit/facter/pe_version_spec.rb
+++ b/spec/unit/facter/pe_version_spec.rb
@@ -26,23 +26,23 @@ describe "PE Version specs" do
(major,minor,patch) = version.split(".")
it "Should return true" do
- Facter.fact(:is_pe).value.should == true
+ expect(Facter.fact(:is_pe).value).to eq(true)
end
it "Should have a version of #{version}" do
- Facter.fact(:pe_version).value.should == version
+ expect(Facter.fact(:pe_version).value).to eq(version)
end
it "Should have a major version of #{major}" do
- Facter.fact(:pe_major_version).value.should == major
+ expect(Facter.fact(:pe_major_version).value).to eq(major)
end
it "Should have a minor version of #{minor}" do
- Facter.fact(:pe_minor_version).value.should == minor
+ expect(Facter.fact(:pe_minor_version).value).to eq(minor)
end
it "Should have a patch version of #{patch}" do
- Facter.fact(:pe_patch_version).value.should == patch
+ expect(Facter.fact(:pe_patch_version).value).to eq(patch)
end
end
end
@@ -54,23 +54,23 @@ describe "PE Version specs" do
end
it "is_pe is false" do
- Facter.fact(:is_pe).value.should == false
+ expect(Facter.fact(:is_pe).value).to eq(false)
end
it "pe_version is nil" do
- Facter.fact(:pe_version).value.should be_nil
+ expect(Facter.fact(:pe_version).value).to be_nil
end
it "pe_major_version is nil" do
- Facter.fact(:pe_major_version).value.should be_nil
+ expect(Facter.fact(:pe_major_version).value).to be_nil
end
it "pe_minor_version is nil" do
- Facter.fact(:pe_minor_version).value.should be_nil
+ expect(Facter.fact(:pe_minor_version).value).to be_nil
end
it "Should have a patch version" do
- Facter.fact(:pe_patch_version).value.should be_nil
+ expect(Facter.fact(:pe_patch_version).value).to be_nil
end
end
end
diff --git a/spec/unit/facter/root_home_spec.rb b/spec/unit/facter/root_home_spec.rb
index 73eb3ea..98fe141 100755
--- a/spec/unit/facter/root_home_spec.rb
+++ b/spec/unit/facter/root_home_spec.rb
@@ -9,7 +9,7 @@ describe Facter::Util::RootHome do
it "should return /" do
Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(root_ent)
- Facter::Util::RootHome.get_root_home.should == expected_root_home
+ expect(Facter::Util::RootHome.get_root_home).to eq(expected_root_home)
end
end
context "linux" do
@@ -18,7 +18,7 @@ describe Facter::Util::RootHome do
it "should return /root" do
Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(root_ent)
- Facter::Util::RootHome.get_root_home.should == expected_root_home
+ expect(Facter::Util::RootHome.get_root_home).to eq(expected_root_home)
end
end
context "windows" do
@@ -26,7 +26,7 @@ describe Facter::Util::RootHome do
Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(nil)
end
it "should be nil on windows" do
- Facter::Util::RootHome.get_root_home.should be_nil
+ expect(Facter::Util::RootHome.get_root_home).to be_nil
end
end
end
@@ -45,7 +45,7 @@ describe 'root_home', :type => :fact do
it "should return /var/root" do
Facter::Util::Resolution.stubs(:exec).with("dscacheutil -q user -a name root").returns(sample_dscacheutil)
- Facter.fact(:root_home).value.should == expected_root_home
+ expect(Facter.fact(:root_home).value).to eq(expected_root_home)
end
end
diff --git a/spec/unit/facter/util/puppet_settings_spec.rb b/spec/unit/facter/util/puppet_settings_spec.rb
index e77779b..c06137d 100755
--- a/spec/unit/facter/util/puppet_settings_spec.rb
+++ b/spec/unit/facter/util/puppet_settings_spec.rb
@@ -11,11 +11,11 @@ describe Facter::Util::PuppetSettings do
end
it 'should be nil' do
- subject.with_puppet { Puppet[:vardir] }.should be_nil
+ expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
it 'should not yield to the block' do
Puppet.expects(:[]).never
- subject.with_puppet { Puppet[:vardir] }.should be_nil
+ expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
end
context "With Puppet loaded" do
@@ -29,7 +29,7 @@ describe Facter::Util::PuppetSettings do
subject.with_puppet { Puppet[:vardir] }
end
it 'should return the nodes vardir' do
- subject.with_puppet { Puppet[:vardir] }.should eq vardir
+ expect(subject.with_puppet { Puppet[:vardir] }).to eq vardir
end
end
end