Skip to content

Commit

Permalink
[RSPEC] Refactored spec for running command with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
hosh committed Mar 22, 2012
1 parent 7e2f70d commit bde3b79
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions spec/mixlib/shellout/shellout_spec.rb
Expand Up @@ -331,15 +331,20 @@
let(:echotext) { 10000.upto(11340).map(&:to_s).join(' ') }
let(:cmd) { "echo #{echotext}" }

it "should execute" do
it 'should execute' do
should eql(echotext)
end
end

it "runs commands with quotes and special characters in quotes" do
cmd = Mixlib::ShellOut.new(%q{ruby -e 'print "<>&|&&||;"'})
cmd.run_command
cmd.stdout.should == "<>&|&&||;"
context 'with special characters' do
subject { stdout }

let(:special_characters) { '<>&|&&||;' }
let(:cmd) { "ruby -e 'print \"#{special_characters}\"'" }

it 'should execute' do
should eql(special_characters)
end
end

it "runs commands with backslashes in them" do
Expand Down

0 comments on commit bde3b79

Please sign in to comment.