Methods
- A
- S
- T
-
- teardown,
- test_add_source_adds_source_to_gemfile,
- test_capify_should_run_the_capify_command,
- test_create_file_should_write_block_contents_to_file_path,
- test_create_file_should_write_data_to_file_path,
- test_env_option_should_win_over_rails_env_variable_when_running_rake,
- test_environment_should_include_data_in_environment_initializer_block,
- test_environment_should_include_data_in_environment_initializer_block_with_env_option,
- test_environment_with_block_should_include_block_contents_in_environment_initializer_block,
- test_gem_falls_back_to_inspect_if_string_contains_single_quote,
- test_gem_group_should_wrap_gems_in_a_group,
- test_gem_should_include_options,
- test_gem_should_insert_on_separate_lines,
- test_gem_should_put_gem_dependency_in_gemfile,
- test_gem_with_non_string_options,
- test_gem_with_version_should_include_version_in_gemfile,
- test_generate_should_run_script_generate_with_argument_and_options,
- test_git_with_hash_should_run_each_command_using_git_scm,
- test_git_with_symbol_should_run_command_using_git_scm,
- test_initializer_should_write_date_to_file_in_config_initializers,
- test_invoke_other_generator_with_full_namespace,
- test_invoke_other_generator_with_shortcut,
- test_lib_should_write_data_to_file_in_lib,
- test_log,
- test_log_with_quiet,
- test_log_with_status,
- test_log_with_status_with_quiet,
- test_rake_should_run_rake_command_with_default_env,
- test_rake_with_env_option_should_run_rake_command_in_env,
- test_rake_with_rails_env_variable_should_run_rake_command_in_env,
- test_rake_with_sudo_option_should_run_rake_command_with_sudo,
- test_rakefile_should_write_date_to_file_in_lib_tasks,
- test_readme,
- test_readme_with_quiet,
- test_route_should_add_data_to_the_routes_block_in_config_routes,
- test_route_should_add_data_with_an_new_line,
- test_vendor_should_write_data_to_file_in_vendor
Included Modules
Instance Public methods
setup()
Link
teardown()
Link
test_add_source_adds_source_to_gemfile()
Link
test_capify_should_run_the_capify_command()
Link
test_create_file_should_write_block_contents_to_file_path()
Link
test_create_file_should_write_data_to_file_path()
Link
test_env_option_should_win_over_rails_env_variable_when_running_rake()
Link
# File railties/test/generators/actions_test.rb, line 196 def test_env_option_should_win_over_rails_env_variable_when_running_rake generator.expects(:run).once.with('rake log:clear RAILS_ENV=production', verbose: false) with_rails_env "staging" do action :rake, 'log:clear', env: 'production' end end
test_environment_should_include_data_in_environment_initializer_block()
Link
# File railties/test/generators/actions_test.rb, line 114 def test_environment_should_include_data_in_environment_initializer_block run_generator autoload_paths = 'config.autoload_paths += %w["#{Rails.root}/app/extras"]' action :environment, autoload_paths assert_file 'config/application.rb', / class Application < Rails::Application\n #{Regexp.escape(autoload_paths)}/ end
test_environment_should_include_data_in_environment_initializer_block_with_env_option()
Link
# File railties/test/generators/actions_test.rb, line 121 def test_environment_should_include_data_in_environment_initializer_block_with_env_option run_generator autoload_paths = 'config.autoload_paths += %w["#{Rails.root}/app/extras"]' action :environment, autoload_paths, env: 'development' assert_file "config/environments/development.rb", /Rails\.application\.configure do\n #{Regexp.escape(autoload_paths)}/ end
test_environment_with_block_should_include_block_contents_in_environment_initializer_block()
Link
# File railties/test/generators/actions_test.rb, line 128 def test_environment_with_block_should_include_block_contents_in_environment_initializer_block run_generator action :environment do _ = '# This wont be added'# assignment to silence parse-time warning "unused literal ignored" '# This will be added' end assert_file 'config/application.rb' do |content| assert_match(/# This will be added/, content) assert_no_match(/# This wont be added/, content) end end
test_gem_falls_back_to_inspect_if_string_contains_single_quote()
Link
test_gem_group_should_wrap_gems_in_a_group()
Link
# File railties/test/generators/actions_test.rb, line 100 def test_gem_group_should_wrap_gems_in_a_group run_generator action :gem_group, :development, :test do gem 'rspec-rails' end action :gem_group, :test do gem 'fakeweb' end assert_file 'Gemfile', /\ngroup :development, :test do\n gem 'rspec-rails'\nend\n\ngroup :test do\n gem 'fakeweb'\nend/ end
test_gem_should_include_options()
Link
test_gem_should_insert_on_separate_lines()
Link
# File railties/test/generators/actions_test.rb, line 62 def test_gem_should_insert_on_separate_lines run_generator File.open('Gemfile', 'a') {|f| f.write('# Some content...') } action :gem, 'rspec' action :gem, 'rspec-rails' assert_file 'Gemfile', /^gem 'rspec'$/ assert_file 'Gemfile', /^gem 'rspec-rails'$/ end
test_gem_should_put_gem_dependency_in_gemfile()
Link
test_gem_with_non_string_options()
Link
# File railties/test/generators/actions_test.rb, line 82 def test_gem_with_non_string_options run_generator action :gem, 'rspec', require: false action :gem, 'rspec-rails', group: [:development, :test] assert_file 'Gemfile', /^gem 'rspec', require: false$/ assert_file 'Gemfile', /^gem 'rspec-rails', group: \[:development, :test\]$/ end
test_gem_with_version_should_include_version_in_gemfile()
Link
test_generate_should_run_script_generate_with_argument_and_options()
Link
test_git_with_hash_should_run_each_command_using_git_scm()
Link
test_git_with_symbol_should_run_command_using_git_scm()
Link
test_initializer_should_write_date_to_file_in_config_initializers()
Link
test_invoke_other_generator_with_full_namespace()
Link
test_invoke_other_generator_with_shortcut()
Link
test_lib_should_write_data_to_file_in_lib()
Link
test_log()
Link
test_log_with_quiet()
Link
test_log_with_status()
Link
test_log_with_status_with_quiet()
Link
test_rake_should_run_rake_command_with_default_env()
Link
test_rake_with_env_option_should_run_rake_command_in_env()
Link
test_rake_with_rails_env_variable_should_run_rake_command_in_env()
Link
# File railties/test/generators/actions_test.rb, line 189 def test_rake_with_rails_env_variable_should_run_rake_command_in_env generator.expects(:run).once.with('rake log:clear RAILS_ENV=production', verbose: false) with_rails_env "production" do action :rake, 'log:clear' end end
test_rake_with_sudo_option_should_run_rake_command_with_sudo()
Link
# File railties/test/generators/actions_test.rb, line 203 def test_rake_with_sudo_option_should_run_rake_command_with_sudo generator.expects(:run).once.with("sudo rake log:clear RAILS_ENV=development", verbose: false) with_rails_env nil do action :rake, 'log:clear', sudo: true end end
test_rakefile_should_write_date_to_file_in_lib_tasks()
Link
test_readme()
Link
test_readme_with_quiet()
Link
# File railties/test/generators/actions_test.rb, line 252 def test_readme_with_quiet generator(default_arguments, quiet: true) run_generator Rails::Generators::AppGenerator.expects(:source_root).times(2).returns(destination_root) assert_no_match "application up and running", action(:readme, "README.rdoc") end
test_route_should_add_data_to_the_routes_block_in_config_routes()
Link
# File railties/test/generators/actions_test.rb, line 215 def test_route_should_add_data_to_the_routes_block_in_config_routes run_generator route_command = "route '/login', controller: 'sessions', action: 'new'" action :route, route_command assert_file 'config/routes.rb', /#{Regexp.escape(route_command)}/ end
test_route_should_add_data_with_an_new_line()
Link
# File railties/test/generators/actions_test.rb, line 222 def test_route_should_add_data_with_an_new_line run_generator action :route, "root 'welcome#index'" route_path = File.expand_path("config/routes.rb", destination_root) content = File.read(route_path) # Remove all of the comments and blank lines from the routes file content.gsub!(/^ \#.*\n/, '') content.gsub!(/^\n/, '') File.open(route_path, "wb") { |file| file.write(content) } assert_file "config/routes.rb", /\.routes\.draw do\n root 'welcome#index'\nend\n\z/ action :route, "resources :product_lines" routes = <<-F Rails.application.routes.draw do resources :product_lines root 'welcome#index' end F assert_file "config/routes.rb", routes end
test_vendor_should_write_data_to_file_in_vendor()
Link
Instance Protected methods