Sha256: 308dcc59a586cb35cf4c23b726562a82a92cb42144771dc6c94b0f4f69b65adb
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 KB
Contents
require File.join(File.dirname(__FILE__), *%w[example_helper]) describe RunCodeRun do describe "activate" do it "defaults to help if no command" do RunCodeRun::Commands.expects(:help) RunCodeRun.activate([]) end end describe "invoke" do it "calls public method on in commands module" do RunCodeRun::Commands.expects(:open) RunCodeRun.invoke("open") end it "calls public method commands module with args" do RunCodeRun::Commands.expects(:open).with("foo", "baz") RunCodeRun.invoke("open", "foo", "baz") end it "fails fast if public method does not exist" do RunCodeRun.stubs(:ui).returns(stub_everything) lambda { RunCodeRun.invoke("good_day_good_sir") }.should raise_error(SystemExit) #, /The command 'good_day_good_sir' does not exist/) end end describe "guess owner" do it "should grab owner for private repos" do output =<<EOL origin git@github.com:relevance/runcoderun.git (fetch) origin git@github.com:relevance/runcoderun.git (push) EOL RunCodeRun.stubs(:run).returns(output) RunCodeRun.guess_owner.should == "relevance" end it "should grab owner for public repos" do output =<<EOL origin git://github.com/defunkt/github.git (fetch) origin git://github.com/defunkt/github.git (push) EOL RunCodeRun.stubs(:run).returns(output) RunCodeRun.guess_owner.should == "defunkt" end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
runcoderun-0.2.2 | examples/runcoderun_example.rb |
runcoderun-0.2.1 | examples/runcoderun_example.rb |
runcoderun-gem-0.1.1 | examples/runcoderun_example.rb |