mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
- Fixed bug in cmock_file_writer_test.rb which caused CMock unit tests to fail on non-Windows systems
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@49 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -23,15 +23,18 @@ class CMockFileWriterTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "create a file when requested and put a block of data in it" do
|
||||
@config.expect.mock_path.returns("C:\\")
|
||||
@config.expect.mock_path.returns("C:\\")
|
||||
|
||||
@cmock_file_writer.create_file("test.txt") do |file, filename|
|
||||
file << "VICTORY!"
|
||||
begin
|
||||
File.delete('test/unit/tmp/test.txt')
|
||||
rescue
|
||||
end
|
||||
|
||||
@config.expect.mock_path.returns("test/unit/tmp/")
|
||||
@config.expect.mock_path.returns("test/unit/tmp/")
|
||||
|
||||
retval = File.open("C:\\test.txt", 'r').readlines[0]
|
||||
assert_equal "VICTORY!", retval
|
||||
@cmock_file_writer.create_file("test.txt") { |file, filename| file << 'VICTORY!' }
|
||||
|
||||
retval = File.open('test/unit/tmp/test.txt', 'r').readlines[0]
|
||||
assert_equal 'VICTORY!', retval
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user