spec/spec_helper.rb in knapsack-0.0.3 vs spec/spec_helper.rb in knapsack-0.1.0
- old
+ new
@@ -10,6 +10,22 @@
config.order = :random
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
+
+ config.expect_with :rspec do |c|
+ c.syntax = :expect
+ end
+
+ config.before(:each) do
+ if RSpec.current_example.metadata[:clear_tmp]
+ FileUtils.mkdir_p(File.join(Knapsack.root, 'tmp'))
+ end
+ end
+
+ config.after(:each) do
+ if RSpec.current_example.metadata[:clear_tmp]
+ FileUtils.rm_r(File.join(Knapsack.root, 'tmp'))
+ end
+ end
end