lib/mattock/testing/rake-example-group.rb in mattock-0.5.3 vs lib/mattock/testing/rake-example-group.rb in mattock-0.7.0
- old
+ new
@@ -11,10 +11,18 @@
include ::Rake::TaskManager
end
def self.included(mod)
mod.class_eval do
+ before :each do
+ @tempdir = File.join "/tmp", "test_mattock_#{$$}"
+
+ @original_PWD = Dir.pwd
+ FileUtils.mkdir_p @tempdir
+ Dir.chdir @tempdir
+ end
+
let! :rake do
::Rake.application = ::Rake::Application.new
::Rake::TaskManager.record_task_metadata = true
RakeFileUtils.verbose_flag = false
::Rake.application
@@ -39,17 +47,9 @@
end
if @original_ENV['APPDATA'].nil?
ENV.delete 'APPDATA'
end
- end
-
- before :each do
- @tempdir = File.join "/tmp", "test_mattock_#{$$}"
-
- @original_PWD = Dir.pwd
- FileUtils.mkdir_p @tempdir
- Dir.chdir @tempdir
end
after :each do
Dir.chdir @original_PWD
FileUtils.rm_rf @tempdir