spec/support/generator_spec_helpers.rb in clearance-2.8.0 vs spec/support/generator_spec_helpers.rb in clearance-2.9.0
- old
+ new
@@ -1,10 +1,20 @@
require "ammeter/rspec/generator/example.rb"
require "ammeter/rspec/generator/matchers.rb"
require "ammeter/init"
module GeneratorSpecHelpers
+ module FileMethods
+ def file(path)
+ Pathname.new(super)
+ end
+
+ def migration_file(path)
+ Pathname.new(super)
+ end
+ end
+
TEMPLATE_PATH = File.expand_path("../../app_templates", __FILE__)
def provide_existing_routes_file
copy_to_generator_root("config", "routes.rb")
end
@@ -34,9 +44,10 @@
end
end
RSpec.configure do |config|
config.include GeneratorSpecHelpers
+ config.prepend GeneratorSpecHelpers::FileMethods
config.before(:example, :generator) do
destination File.expand_path("../../../tmp", __FILE__)
prepare_destination
end