Skip to content

Instantly share code, notes, and snippets.

@jmazzi
Created August 7, 2012 13:59
Show Gist options
  • Save jmazzi/3285581 to your computer and use it in GitHub Desktop.
Save jmazzi/3285581 to your computer and use it in GitHub Desktop.
class BackTicks
def run
`pwd`
end
end
describe BackTicks do
subject { BackTicks.new }
it "should execute run" do
subject.should_receive(:`).with('pwd').and_return '/home'
subject.run.should == '/home'
end
end
@jmazzi
Copy link
Author

jmazzi commented Aug 7, 2012

.

Finished in 0.0004 seconds
1 example, 0 failures

@hoitomt
Copy link

hoitomt commented Jun 27, 2014

Very helpful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment