Back to mocha for now. Flexmock made stubbing awkward.

This commit is contained in:
Mitchell Hashimoto 2010-01-21 23:57:31 -08:00
parent a628274e94
commit 41a474dd77
3 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@ gem "net-ssh", ">= 2.0.19"
# gem bundle test
only :test do
gem "contest", ">= 0.1.2"
gem "flexmock", ">= 0.8.2"
gem "mocha"
gem "ruby-debug", ">= 0.10.3" if RUBY_VERSION < '1.9'
end

View File

@ -3,12 +3,13 @@ require File.join(File.dirname(__FILE__), '..', 'test_helper')
class VirtualBoxTest < Test::Unit::TestCase
setup do
# Stub out command so nothing actually happens
flexmock(VirtualBox)
VirtualBox.stubs(:command)
end
context "modifying VMs" do
should "wrap double quotes around values with spaces" do
VirtualBox.should_receive(:command).with(/"my value"/)
# TODO: how to use mocha with regex expectations?
#VirtualBox.expects(:command).with(/"my value"/)
VirtualBox.modify(@name, "key", "my value")
end
end

View File

@ -20,4 +20,4 @@ rescue LoadError; end
require File.join(File.dirname(__FILE__), '..', 'lib', 'hobo')
require 'contest'
require 'flexmock/test_unit'
require 'mocha'