Namespace
Methods
A
N
T
Included Modules
Class Public methods
new(console)
# File railties/test/commands/console_test.rb, line 133
def initialize(console)
  @console = console
end
Instance Public methods
available_environments()
# File railties/test/commands/console_test.rb, line 107
def available_environments
  ['dev']
end
test_console_defaults_to_IRB()
# File railties/test/commands/console_test.rb, line 54
def test_console_defaults_to_IRB
  app = build_app(nil)
  assert_equal IRB, Rails::Console.new(app).console
end
test_console_with_environment()
# File railties/test/commands/console_test.rb, line 49
def test_console_with_environment
  start ["-e production"]
  assert_match(/\sproduction\s/, output)
end
test_default_environment_with_no_rails_env()
# File railties/test/commands/console_test.rb, line 59
def test_default_environment_with_no_rails_env
  with_rails_env nil do
    start
    assert_match(/\sdevelopment\s/, output)
  end
end
test_default_environment_with_rack_env()
# File railties/test/commands/console_test.rb, line 73
def test_default_environment_with_rack_env
  with_rack_env 'production' do
    start
    assert_match(/\sproduction\s/, output)
  end
end
test_default_environment_with_rails_env()
# File railties/test/commands/console_test.rb, line 66
def test_default_environment_with_rails_env
  with_rails_env 'special-production' do
    start
    assert_match(/\sspecial-production\s/, output)
  end
end
test_e_option()
# File railties/test/commands/console_test.rb, line 80
def test_e_option
  start ['-e', 'special-production']
  assert_match(/\sspecial-production\s/, output)
end
test_environment_option()
# File railties/test/commands/console_test.rb, line 85
def test_environment_option
  start ['--environment=special-production']
  assert_match(/\sspecial-production\s/, output)
end
test_no_options()
# File railties/test/commands/console_test.rb, line 28
def test_no_options
  console = Rails::Console.new(app, parse_arguments([]))
  assert !console.sandbox?
end
test_rails_env_is_dev_when_argument_is_dev_and_dev_env_is_present()
# File railties/test/commands/console_test.rb, line 105
def test_rails_env_is_dev_when_argument_is_dev_and_dev_env_is_present
  stubbed_console = Class.new(Rails::Console) do
    def available_environments
      ['dev']
    end
  end
  options = stubbed_console.parse_arguments(['dev'])
  assert_match('dev', options[:environment])
end
test_rails_env_is_development_when_argument_is_d()
# File railties/test/commands/console_test.rb, line 100
def test_rails_env_is_development_when_argument_is_d
  start ['d']
  assert_match(/\sdevelopment\s/, output)
end
test_rails_env_is_production_when_first_argument_is_p()
# File railties/test/commands/console_test.rb, line 90
def test_rails_env_is_production_when_first_argument_is_p
  start ['p']
  assert_match(/\sproduction\s/, output)
end
test_rails_env_is_test_when_first_argument_is_t()
# File railties/test/commands/console_test.rb, line 95
def test_rails_env_is_test_when_first_argument_is_t
  start ['t']
  assert_match(/\stest\s/, output)
end
test_sandbox_option()
# File railties/test/commands/console_test.rb, line 18
def test_sandbox_option
  console = Rails::Console.new(app, parse_arguments(["--sandbox"]))
  assert console.sandbox?
end
test_short_version_of_sandbox_option()
# File railties/test/commands/console_test.rb, line 23
def test_short_version_of_sandbox_option
  console = Rails::Console.new(app, parse_arguments(["-s"]))
  assert console.sandbox?
end
test_start()
# File railties/test/commands/console_test.rb, line 33
def test_start
  start

  assert app.console.started?
  assert_match(/Loading \w+ environment \(Rails/, output)
end
test_start_with_sandbox()
# File railties/test/commands/console_test.rb, line 40
def test_start_with_sandbox
  start ["--sandbox"]


  assert app.console.started?
  assert app.sandbox
  assert_match(/Loading \w+ environment in sandbox \(Rails/, output)
end