diff options
author | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-22 13:56:37 -0400 |
---|---|---|
committer | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-22 13:56:37 -0400 |
commit | cf2128b5c311bc502e20fe10d24eae356c3dc9d2 (patch) | |
tree | 6809b038a84a3ddfe7a1636b92d55b0d2410d34a /spec | |
parent | 9f45773fa521510faf92c4a56a0fa2a534f2af0b (diff) | |
download | mixlib-shellout-cf2128b5c311bc502e20fe10d24eae356c3dc9d2.tar.gz |
[RSPEC] Use metadata to filter out unix-only examples
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/shellout/shellout_spec.rb | 14 | ||||
-rw-r--r-- | spec/mixlib/spec_helper.rb | 9 |
2 files changed, 7 insertions, 16 deletions
diff --git a/spec/mixlib/shellout/shellout_spec.rb b/spec/mixlib/shellout/shellout_spec.rb index 6baaedb..f331966 100644 --- a/spec/mixlib/shellout/shellout_spec.rb +++ b/spec/mixlib/shellout/shellout_spec.rb @@ -57,11 +57,8 @@ describe Mixlib::ShellOut do let(:expected_uid) { user_info.uid } let(:user_info) { Etc.getpwent } - it "should compute the uid of the user" do - # This should use metadata filtering instead - unless windows? - shell_cmd.uid.should eql(expected_uid) - end + it "should compute the uid of the user", :skip_windows => true do + shell_cmd.uid.should eql(expected_uid) end end @@ -88,11 +85,8 @@ describe Mixlib::ShellOut do let(:expected_gid) { group_info.gid } let(:group_info) { Etc.getgrent } - it "should compute the gid of the user" do - # This should use metadata filtering instead - unless windows? - shell_cmd.gid.should eql(expected_gid) - end + it "should compute the gid of the user", :skip_windows => true do + shell_cmd.gid.should eql(expected_gid) end end end diff --git a/spec/mixlib/spec_helper.rb b/spec/mixlib/spec_helper.rb index 731617c..5723960 100644 --- a/spec/mixlib/spec_helper.rb +++ b/spec/mixlib/spec_helper.rb @@ -3,14 +3,10 @@ require 'mixlib/shellout' require 'ap' def windows? - if RUBY_PLATFORM =~ /mswin|mingw|windows/ - true - else - false - end + !!(RUBY_PLATFORM =~ /mswin|mingw|windows/) end -if RUBY_PLATFORM =~ /mswin|mingw|windows/ +if windows? LINE_ENDING = "\r\n" ECHO_LC_ALL = "echo %LC_ALL%" else @@ -22,5 +18,6 @@ RSpec.configure do |config| config.mock_with :rspec config.filter_run :focus => true config.filter_run_excluding :external => true + config.filter_run_excluding :skip_windows => true if windows? config.run_all_when_everything_filtered = true end |