Skip to content

Commit

Permalink
Commented Tempfile usage in spec, led to subtle bugs on MacOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
blambeau committed Jan 7, 2011
1 parent f492f68 commit ef5d5fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,2 +1,4 @@
.DS_Store
pkg
pkg
spec/mocker.rb
spec/mocker_output.txt
6 changes: 3 additions & 3 deletions spec/sfl_spec.rb
Expand Up @@ -37,13 +37,13 @@
describe 'Kernel.spawn' do
def mocker(code)
sfl_expanded = File.expand_path('../../lib/sfl', __FILE__)
rubyfile = Tempfile.new('-').path
rubyfile = File.expand_path('../mocker.rb', __FILE__) # Tempfile.new('-').path
File.open(rubyfile, 'w') {|io| io.puts <<-"EOF"
require '#{sfl_expanded}'
#{code}
EOF
}
resultfile = Tempfile.new('-').path
resultfile = File.expand_path('../mocker_output.txt', __FILE__) # Tempfile.new('-').path
system "ruby #{rubyfile} > #{resultfile}"
File.read(resultfile)
end
Expand All @@ -53,7 +53,7 @@ def mocker(code)
mocker(%q|
pid = Kernel.spawn('ls', '.')
Process.wait(pid)
|).should == `ls`
|).should == `ls .`
end
end

Expand Down

0 comments on commit ef5d5fc

Please sign in to comment.