diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-12-29 20:09:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 20:09:43 +0100 |
commit | ca3eb2c1569a86e9c7eee2e9877dd773797a76b4 (patch) | |
tree | 016b5f2247d6ad4d95f1b1f05c897b5472abb7bf /railties/lib/rails/generators/testing | |
parent | 654704247eba742e139cfaa8d1385f13605d9e12 (diff) | |
parent | c491bf012948383632e53f874c552041a6e23b36 (diff) | |
download | rails-ca3eb2c1569a86e9c7eee2e9877dd773797a76b4.tar.gz rails-ca3eb2c1569a86e9c7eee2e9877dd773797a76b4.tar.bz2 rails-ca3eb2c1569a86e9c7eee2e9877dd773797a76b4.zip |
Merge branch 'master' into fix_26964
Diffstat (limited to 'railties/lib/rails/generators/testing')
-rw-r--r-- | railties/lib/rails/generators/testing/behaviour.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/testing/behaviour.rb b/railties/lib/rails/generators/testing/behaviour.rb index a1e5a233b9..64d641d096 100644 --- a/railties/lib/rails/generators/testing/behaviour.rb +++ b/railties/lib/rails/generators/testing/behaviour.rb @@ -82,23 +82,23 @@ module Rails Rails::Generators::GeneratedAttribute.parse([name, attribute_type, index].compact.join(":")) end - protected + private - def destination_root_is_set? # :nodoc: + def destination_root_is_set? raise "You need to configure your Rails::Generators::TestCase destination root." unless destination_root end - def ensure_current_path # :nodoc: + def ensure_current_path cd current_path end # Clears all files and directories in destination. - def prepare_destination + def prepare_destination # :doc: rm_rf(destination_root) mkdir_p(destination_root) end - def migration_file_name(relative) # :nodoc: + def migration_file_name(relative) absolute = File.expand_path(relative, destination_root) dirname, file_name = File.dirname(absolute), File.basename(absolute).sub(/\.rb$/, "") Dir.glob("#{dirname}/[0-9]*_*.rb").grep(/\d+_#{file_name}.rb$/).first |