Don't need mocks here

This commit is contained in:
Jack Nagel 2014-07-07 17:34:30 -05:00
parent 879ec96743
commit 0f54f7f072

View File

@ -35,17 +35,15 @@ class BuildEnvironmentTests < Homebrew::TestCase
end end
def test_env_block def test_env_block
foo = mock("foo") error = Class.new(StandardError)
@env.proc = Proc.new { foo.some_message } @env.proc = Proc.new { raise error }
foo.expects(:some_message) assert_raises(error) { @env.modify_build_environment(self) }
@env.modify_build_environment(self)
end end
def test_env_block_with_argument def test_env_block_with_argument
foo = mock("foo") error = Class.new(StandardError)
@env.proc = Proc.new { |x| x.some_message } @env.proc = Proc.new { |x| raise x }
foo.expects(:some_message) assert_raises(error) { @env.modify_build_environment(error) }
@env.modify_build_environment(foo)
end end
end end