spec/spec_helper.rb in timcharper-spork-0.5.0 vs spec/spec_helper.rb in timcharper-spork-0.5.5

- old
+ new

@@ -16,10 +16,11 @@ Spec::Runner.configure do |config| config.before(:each) do $test_stdout = StringIO.new $test_stderr = StringIO.new + @current_dir = nil end config.after(:each) do FileUtils.rm_rf(SPEC_TMP_DIR) if File.directory?(SPEC_TMP_DIR) @@ -38,9 +39,13 @@ Dir.chdir(current_dir, &block) end def current_dir @current_dir ||= SPEC_TMP_DIR + end + + def change_current_dir(sub_path) + @current_dir = File.expand_path(sub_path, SPEC_TMP_DIR) end end module Spec