Skip to content

Commit

Permalink
Fix No such file or directory tmp/cache issue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jun 11, 2015
1 parent 4752e67 commit 460150f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/generators/scaffold_controller_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# require 'active_model/serializer/railtie'

class ResourceGeneratorTest < Rails::Generators::TestCase
destination File.expand_path('../../tmp', __FILE__)
destination File.expand_path('../../../tmp/generators', __FILE__)
setup :prepare_destination, :copy_routes

tests Rails::Generators::ResourceGenerator
Expand Down
2 changes: 1 addition & 1 deletion test/generators/serializer_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'generators/serializer/serializer_generator'

class SerializerGeneratorTest < Rails::Generators::TestCase
destination File.expand_path("../../tmp", __FILE__)
destination File.expand_path("../../../tmp/generators", __FILE__)
setup :prepare_destination

tests Rails::Generators::SerializerGenerator
Expand Down
3 changes: 2 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'action_controller/railtie'
require 'active_support/json'
require 'minitest/autorun'
require 'fileutils'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)

Expand All @@ -21,7 +22,7 @@ class Foo < Rails::Application
ActionController::Base.cache_store = :memory_store
end
end
ActionController::Base.cache_store.clear
FileUtils.mkdir_p(File.expand_path('../../tmp/cache', __FILE__))
Foo.initialize!

require 'fixtures/poro'
Expand Down

0 comments on commit 460150f

Please sign in to comment.