From 2c08152ba6d67815523a5ecff45b88e787ad449b Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 18 Nov 2011 14:18:08 -0500 Subject: [PATCH] Remove the compiled .rbc file from Rubinius so it will regenerate This will fix the problem on the CI server, where some time the change occurred by "write_file" will not trigger Rubinius to generate a compiled .rbc file. --- features/step_definitions/attachment_steps.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/features/step_definitions/attachment_steps.rb b/features/step_definitions/attachment_steps.rb index c3b78d606..616237423 100644 --- a/features/step_definitions/attachment_steps.rb +++ b/features/step_definitions/attachment_steps.rb @@ -10,15 +10,12 @@ def attachment_path(filename) World(AttachmentHelpers) When /^I modify my attachment definition to:$/ do |definition| - in_current_dir do - File.open("app/models/user.rb", "w") do |file| - file.write <<-FILE - class User < ActiveRecord::Base - #{definition} - end - FILE + write_file "app/models/user.rb", <<-FILE + class User < ActiveRecord::Base + #{definition} end - end + FILE + remove_file 'app/models/user.rbc' rescue nil end When /^I upload the fixture "([^"]*)"$/ do |filename|