aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/actions_test.rb2
-rw-r--r--railties/test/generators/scaffold_generator_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index f421207025..a54a6dbc28 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -403,7 +403,7 @@ class ActionsTest < Rails::Generators::TestCase
content.gsub!(/^ \#.*\n/, "")
content.gsub!(/^\n/, "")
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
routes = <<-F
Rails.application.routes.draw do
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index 29426cd99f..3e631f6021 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -347,7 +347,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
content = File.read(route_path).gsub(/\.routes\.draw do/) do |match|
"#{match} |map|"
end
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
run_generator ["product_line"], behavior: :revoke
@@ -364,7 +364,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
content.gsub!(/^ \#.*\n/, "")
content.gsub!(/^\n/, "")
- File.open(route_path, "wb") { |file| file.write(content) }
+ File.write(route_path, content)
assert_file "config/routes.rb", /\.routes\.draw do\n resources :product_lines\nend\n\z/
run_generator ["product_line"], behavior: :revoke