Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[RSPEC] Refactored spec for running command with special characters

  • Loading branch information...
commit bde3b79691808d802dc78535b8be1b82327f891e 1 parent 7e2f70d
@hosh authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 spec/mixlib/shellout/shellout_spec.rb
View
15 spec/mixlib/shellout/shellout_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.