Skip to content

Instantly share code, notes, and snippets.

@jmazzi
Created August 7, 2012 13:59
Show Gist options
  • Select an option

  • Save jmazzi/3285581 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
Author

jmazzi commented Aug 7, 2012

.

Finished in 0.0004 seconds
1 example, 0 failures

@hoitomt
Copy link
Copy Markdown

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