Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

take command is implemented!

  • Loading branch information...
commit ce22141802a9b276f9697d4adf4960dd47319d01 1 parent 8ca1fb4
@tenderlove tenderlove authored
Showing with 44 additions and 0 deletions.
  1. +13 −0 test/commands/test_fix.rb
  2. +31 −0 test/commands/test_take.rb
View
13 test/commands/test_fix.rb
@@ -48,6 +48,19 @@ def test_execute_not_fixable
fake_command.new(recorder, {'qa' => 'foo'}).execute!
end
+ def test_execute_no_qa
+ recorder = Object.new
+ flexmock(recorder) do |thing|
+ thing.should_receive(:startable?).once.and_return(false)
+ thing.should_receive(:start!).never
+ thing.should_receive(:fixable?).once.and_return(false)
+ thing.should_receive(:fix!).never
+ thing.should_receive(:assign_to).never
+ end
+
+ fake_command.new(recorder, {'qa' => nil}).execute!
+ end
+
def fake_command
Class.new(Geera::Commands::Fix) {
def initialize ticket, config
View
31 test/commands/test_take.rb
@@ -0,0 +1,31 @@
+require "test/unit"
+require "geera"
+require 'flexmock/test_unit'
+
+module Geera
+ module Commands
+ class TestTake < Test::Unit::TestCase
+ def test_handle?
+ assert Take.handle?('take')
+ end
+
+ def test_execute!
+ recorder = Object.new
+ flexmock(recorder) do |thing|
+ thing.should_receive(:assign_to).with('foo').once
+ end
+
+ fake_command.new(recorder, 'username' => 'foo').execute!
+ end
+
+ def fake_command
+ Class.new(Geera::Commands::Take) {
+ def initialize ticket, config
+ super(config, nil, nil, nil)
+ @ticket = ticket
+ end
+ }
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.