Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[RSPEC] Use Rspec 3 metadata

  • Loading branch information...
commit e2ef96f211d8e38e844f90537abb9cd27921e187 1 parent 37117fd
@hosh hosh authored hosh committed
View
2  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
View
24 spec/mixlib/shellout_spec.rb
@@ -72,7 +72,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
end
end
- pending 'when running under Windows', :windows_only => true
+ pending 'when running under Windows', :windows_only
end
context 'without input data' do
View
1  spec/spec_helper.rb
@@ -24,4 +24,5 @@
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

0 comments on commit e2ef96f

Please sign in to comment.
Something went wrong with that request. Please try again.