Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change internally used --autotest option to --tty

- Closes #224.
  • Loading branch information...
commit 285b438f082eefa9853ddb58bebe841117b0646f 1 parent 921bb6a
@dchelimsky dchelimsky authored
View
6 lib/rspec/core/configuration.rb
@@ -34,7 +34,7 @@ def self.add_setting(name, opts={})
add_setting :files_to_run
add_setting :include_or_extend_modules
add_setting :backtrace_clean_patterns
- add_setting :autotest
+ add_setting :tty
def initialize
@color_enabled = false
@@ -149,7 +149,7 @@ def full_backtrace=(bool)
end
def color_enabled
- @color_enabled && (output_to_tty? || autotest?)
+ @color_enabled && output_to_tty?
end
def color_enabled?
@@ -346,7 +346,7 @@ def raise_if_rspec_1_is_loaded
def output_to_tty?
begin
- settings[:output_stream].tty?
+ output_stream.tty? || tty?
rescue NoMethodError
false
end
View
2  lib/rspec/core/configuration_options.rb
@@ -28,7 +28,7 @@ def drb_argv
argv << "--color" if options[:color_enabled]
argv << "--profile" if options[:profile_examples]
argv << "--backtrace" if options[:full_backtrace]
- argv << "--autotest" if options[:autotest]
+ argv << "--tty" if options[:tty]
argv << "--fail-fast" if options[:fail_fast]
argv << "--format" << options[:formatter] if options[:formatter]
argv << "--line_number" << options[:line_number] if options[:line_number]
View
4 lib/rspec/core/option_parser.rb
@@ -96,8 +96,8 @@ def parser(options)
options[:drb_port] = o.to_i
end
- parser.on('--autotest') do |o|
- options[:autotest] = true
+ parser.on('--tty') do |o|
+ options[:tty] = true
end
parser.on('--fail-fast', 'Use the fail_fast option to tell RSpec to abort the run on first failure.') do |o|
View
4 spec/rspec/core/configuration_options_spec.rb
@@ -193,8 +193,8 @@ def options_from_args(*args)
it "renders all the original arguments except --drb" do
File.stub(:exist?) { true }
IO.stub(:read) { "--drb --color" }
- config_options_object(*%w[ --autotest --format s --line_number 1 --example pattern --profile --backtrace ]).
- drb_argv.should eq(%w[ --color --profile --backtrace --autotest --format s --line_number 1 --example pattern ])
+ config_options_object(*%w[ --tty --format s --line_number 1 --example pattern --profile --backtrace ]).
+ drb_argv.should eq(%w[ --color --profile --backtrace --tty --format s --line_number 1 --example pattern ])
end
end
View
8 spec/rspec/core/configuration_spec.rb
@@ -256,7 +256,7 @@ def that_thing
it "does not set color_enabled" do
config.output_stream = StringIO.new
config.output_stream.stub(:tty?) { false }
- config.autotest = false
+ config.tty = false
config.color_enabled = true
config.color_enabled.should be_false
end
@@ -266,17 +266,17 @@ def that_thing
it "does not set color_enabled" do
config.output_stream = StringIO.new
config.output_stream.stub(:tty?) { true }
- config.autotest = false
+ config.tty = false
config.color_enabled = true
config.color_enabled.should be_true
end
end
- context "with autotest output" do
+ context "with tty set" do
it "does not set color_enabled" do
config.output_stream = StringIO.new
config.output_stream.stub(:tty?) { false }
- config.autotest = true
+ config.tty = true
config.color_enabled = true
config.color_enabled.should be_true
end
Please sign in to comment.
Something went wrong with that request. Please try again.