Permalink
Browse files

Fix some broken cli specs.

Nachos::Cli#main was being stubbed on one instance. Since #invoke
creates a new instance, the stub wasn't being used, causing
FakeWeb to yell at you for making real GET requests. Fix was to
stub #main on any instance of Nachos::Cli (like the other specs).
  • Loading branch information...
1 parent b6c85cd commit 568e042d4c5a9785fbc0396f1e51942a90c787a5 @blaix blaix committed Mar 11, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 spec/nachos/cli_spec.rb
View
@@ -54,16 +54,17 @@
end
it "calls sync on main" do
- cli = Nachos::CLI.new
main = stub_everything(:github_summary => "")
main.expects(:sync)
- cli.stubs(:main).returns(main)
+ Nachos::CLI.any_instance.stubs(:main).returns(main)
+ cli = Nachos::CLI.new
cli.invoke(:sync)
end
it "displays summary sync info" do
+ main = stub_everything(:github_summary => "sync summary")
+ Nachos::CLI.any_instance.stubs(:main).returns(main)
cli = Nachos::CLI.new
- cli.stubs(:main).returns(stub_everything(:github_summary => "sync summary"))
cli.invoke(:sync)
cli.shell.output.should include("sync summary")
end

0 comments on commit 568e042

Please sign in to comment.