More redundant test code removing

This commit is contained in:
Mitchell Hashimoto 2010-04-08 23:32:26 -07:00
parent 4e54cc77a2
commit c0c3313fdd
3 changed files with 13 additions and 10 deletions

View File

@ -91,7 +91,7 @@ class Test::Unit::TestCase
[mock_vm, vm, action]
end
def stub_default_action_dependecies(mock, klass=MockAction)
def stub_default_action_dependecies(mock)
mock.stubs(:precedes).returns([])
mock.stubs(:follows).returns([])
end
@ -105,6 +105,3 @@ class Test::Unit::TestCase
end
end
class MockAction; end
class MockActionOther; end

View File

@ -1,6 +1,9 @@
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
class CollectionTest < Test::Unit::TestCase
class MockAction; end
class MockActionOther; end
context "checking uniqueness" do
setup do
@actions = Vagrant::Actions::Collection.new([1])

View File

@ -1,6 +1,9 @@
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
class ActionRunnerTest < Test::Unit::TestCase
class MockAction; end
class MockActionOther; end
def mock_fake_action(action_klass = nil, runner = nil)
action = action_klass ? action_klass.new(runner) : mock("action")
action.stubs(:prepare)
@ -162,7 +165,7 @@ class ActionRunnerTest < Test::Unit::TestCase
[MockAction, MockActionOther].each_with_index do |klass, i|
action = mock("action#{i}")
action.expects(:class).returns(klass)
stub_default_action_dependecies(action, klass)
stub_default_action_dependecies(action)
@runner.actions << action
actions << action
end