summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-04-03 20:26:38 -0400
committerHo-Sheng Hsiao <hosh@opscode.com>2012-05-10 14:51:43 -0400
commite2ef96f211d8e38e844f90537abb9cd27921e187 (patch)
treeebcfdef48739abded29ded7931d5cae4281770e4
parent37117fdc7fa08be7783b7f38abad7e5a771047eb (diff)
downloadmixlib-shellout-e2ef96f211d8e38e844f90537abb9cd27921e187.tar.gz
[RSPEC] Use Rspec 3 metadata
-rw-r--r--spec/mixlib/shellout/windows_spec.rb2
-rw-r--r--spec/mixlib/shellout_spec.rb24
-rw-r--r--spec/spec_helper.rb1
3 files changed, 14 insertions, 13 deletions
diff --git a/spec/mixlib/shellout/windows_spec.rb b/spec/mixlib/shellout/windows_spec.rb
index 9a5684d..be515be 100644
--- a/spec/mixlib/shellout/windows_spec.rb
+++ b/spec/mixlib/shellout/windows_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe 'Mixlib::ShellOut::Windows', :windows_only => true do
+describe 'Mixlib::ShellOut::Windows', :windows_only do
describe 'Utils' do
describe '.should_run_under_cmd?' do
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 3f0800b..cc59829 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -72,7 +72,7 @@ describe Mixlib::ShellOut do
let(:expected_uid) { user_info.uid }
let(:user_info) { Etc.getpwent }
- it "should compute the uid of the user", :unix_only => true do
+ it "should compute the uid of the user", :unix_only do
shell_cmd.uid.should eql(expected_uid)
end
end
@@ -100,7 +100,7 @@ describe Mixlib::ShellOut do
let(:expected_gid) { group_info.gid }
let(:group_info) { Etc.getgrent }
- it "should compute the gid of the user", :unix_only => true do
+ it "should compute the gid of the user", :unix_only do
shell_cmd.gid.should eql(expected_gid)
end
end
@@ -297,7 +297,7 @@ describe Mixlib::ShellOut do
let(:fully_qualified_cwd) { File.expand_path(cwd) }
let(:options) { { :cwd => cwd } }
- context 'when running under Unix', :unix_only => true do
+ context 'when running under Unix', :unix_only do
let(:cwd) { '/bin' }
let(:cmd) { 'pwd' }
@@ -306,7 +306,7 @@ describe Mixlib::ShellOut do
end
end
- context 'when running under Windows', :windows_only => true do
+ context 'when running under Windows', :windows_only do
let(:cwd) { Dir.tmpdir }
let(:cmd) { 'echo %cd%' }
@@ -339,7 +339,7 @@ describe Mixlib::ShellOut do
context 'with LC_ALL set to nil' do
let(:locale) { nil }
- context 'when running under Unix', :unix_only => true do
+ context 'when running under Unix', :unix_only do
let(:parent_locale) { ENV['LC_ALL'].to_s.strip }
it "should use the parent process's locale" do
@@ -347,7 +347,7 @@ describe Mixlib::ShellOut do
end
end
- context 'when running under Windows', :windows_only => true do
+ context 'when running under Windows', :windows_only do
# On windows, if an environmental variable is not set, it returns the key
let(:parent_locale) { (ENV['LC_ALL'] || '%LC_ALL%').to_s.strip }
@@ -395,7 +395,7 @@ describe Mixlib::ShellOut do
let(:cmd) { script_name }
- context 'when running under Unix', :unix_only => true do
+ context 'when running under Unix', :unix_only do
let(:script_content) { 'echo blah' }
it 'should execute' do
@@ -403,7 +403,7 @@ describe Mixlib::ShellOut do
end
end
- context 'when running under Windows', :windows_only => true do
+ context 'when running under Windows', :windows_only do
let(:cmd) { "#{script_name} #{argument}" }
let(:script_content) { '@echo %1' }
let(:argument) { rand(10000).to_s }
@@ -765,7 +765,7 @@ describe Mixlib::ShellOut do
stdout.should_not be_empty
end
- it 'should close all pipes', :unix_only => true do
+ it 'should close all pipes', :unix_only do
unclosed_pipes.should be_empty
end
end
@@ -832,7 +832,7 @@ describe Mixlib::ShellOut do
end
end
- context 'when subprocess closes prematurely', :unix_only => true do
+ context 'when subprocess closes prematurely', :unix_only do
context 'with input data' do
let(:ruby_code) { 'bad_ruby { [ } ]' }
let(:options) { { :input => input } }
@@ -878,7 +878,7 @@ describe Mixlib::ShellOut do
context 'when execution fails' do
let(:cmd) { "fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu" }
- context 'when running under Unix', :unix_only => true do
+ context 'when running under Unix', :unix_only do
it "should recover the error message" do
lambda { executed_cmd }.should raise_error(Errno::ENOENT)
end
@@ -893,7 +893,7 @@ describe Mixlib::ShellOut do
end
end
- pending 'when running under Windows', :windows_only => true
+ pending 'when running under Windows', :windows_only
end
context 'without input data' do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index cb6d017..0eab6ba 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -24,4 +24,5 @@ RSpec.configure do |config|
config.filter_run_excluding :unix_only => true unless unix?
config.run_all_when_everything_filtered = true
+ config.treat_symbols_as_metadata_keys_with_true_values = true
end