0
@@ -17,12 +17,12 @@ describe "OptionParser" do
0
options = parse(["--pattern", "foo"])
0
options.filename_pattern.should == "foo"
0
it "should accept dry run option" do
0
options = parse(["--dry-run"])
0
options.dry_run.should be_true
0
it "should eval and use custom formatter when none of the builtins" do
0
options = parse(["--format", "Custom::Formatter"])
0
options.formatters[0].class.should be(Custom::Formatter)
0
@@ -40,17 +40,17 @@ describe "OptionParser" do
0
options.formatters[2].where.should eql("foo\\bar")
0
options.formatters[3].where.should eql("/foo/bar")
0
it "should not be verbose by default" do
0
options.verbose.should be_nil
0
it "should not use colour by default" do
0
options.colour.should == false
0
it "should print help to stdout if no args" do
0
pending 'A regression since 1.0.8' do
0
@@ -58,13 +58,13 @@ describe "OptionParser" do
0
@out.read.should match(/Usage: spec \(FILE\|DIRECTORY\|GLOB\)\+ \[options\]/m)
0
it "should print help to stdout" do
0
options = parse(["--help"])
0
@out.read.should match(/Usage: spec \(FILE\|DIRECTORY\|GLOB\)\+ \[options\]/m)
0
it "should print instructions about how to require missing formatter" do
0
options = parse(["--format", "Custom::MissingFormatter"])
0
@@ -72,7 +72,7 @@ describe "OptionParser" do
0
end.should raise_error(NameError)
0
@err.string.should match(/Couldn't find formatter class Custom::MissingFormatter/n)
0
it "should print version to stdout" do
0
options = parse(["--version"])
0
@@ -84,37 +84,37 @@ describe "OptionParser" do
0
parse(["--require", "whatever"])
0
end.should raise_error(LoadError)
0
it "should support c option" do
0
options = parse(["-c"])
0
options.colour.should be_true
0
it "should support queens colour option" do
0
options = parse(["--colour"])
0
options.colour.should be_true
0
it "should support us color option" do
0
options = parse(["--color"])
0
options.colour.should be_true
0
it "should support single example with -e option" do
0
options = parse(["-e", "something or other"])
0
options.examples.should eql(["something or other"])
0
it "should support single example with -s option (will be removed when autotest supports -e)" do
0
options = parse(["-s", "something or other"])
0
options.examples.should eql(["something or other"])
0
it "should support single example with --example option" do
0
options = parse(["--example", "something or other"])
0
options.examples.should eql(["something or other"])
0
it "should read several example names from file if --example is given an existing file name" do
0
options = parse(["--example", File.dirname(__FILE__) + '/examples.txt'])
0
options.examples.should eql([
0
@@ -126,27 +126,27 @@ describe "OptionParser" do
0
options = parse(["--example", File.dirname(__FILE__) + '/empty_file.txt'])
0
options.examples.should eql([])
0
it "should use html formatter when format is h" do
0
options = parse(["--format", "h"])
0
options.formatters[0].class.should equal(Spec::Runner::Formatter::HtmlFormatter)
0
it "should use html story formatter when format is h" do
0
options = parse(["--format", "h"])
0
options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
0
it "should use html formatter when format is html" do
0
options = parse(["--format", "html"])
0
options.formatters[0].class.should equal(Spec::Runner::Formatter::HtmlFormatter)
0
it "should use html story formatter when format is html" do
0
options = parse(["--format", "html"])
0
options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
0
it "should use html formatter with explicit output when format is html:test.html" do
0
FileUtils.rm 'test.html' if File.exist?('test.html')
0
options = parse(["--format", "html:test.html"])
0
@@ -156,69 +156,69 @@ describe "OptionParser" do
0
options.formatters[0].close
0
FileUtils.rm 'test.html'
0
it "should use noisy backtrace tweaker with b option" do
0
options = parse(["-b"])
0
options.backtrace_tweaker.should be_instance_of(Spec::Runner::NoisyBacktraceTweaker)
0
it "should use noisy backtrace tweaker with backtrace option" do
0
options = parse(["--backtrace"])
0
options.backtrace_tweaker.should be_instance_of(Spec::Runner::NoisyBacktraceTweaker)
0
it "should use quiet backtrace tweaker by default" do
0
options.backtrace_tweaker.should be_instance_of(Spec::Runner::QuietBacktraceTweaker)
0
it "should use progress bar formatter by default" do
0
options.formatters[0].class.should equal(Spec::Runner::Formatter::ProgressBarFormatter)
0
it "should use specdoc formatter when format is s" do
0
options = parse(["--format", "s"])
0
options.formatters[0].class.should equal(Spec::Runner::Formatter::SpecdocFormatter)
0
it "should use specdoc formatter when format is specdoc" do
0
options = parse(["--format", "specdoc"])
0
options.formatters[0].class.should equal(Spec::Runner::Formatter::SpecdocFormatter)
0
it "should support diff option when format is not specified" do
0
options = parse(["--diff"])
0
options.diff_format.should == :unified
0
it "should use unified diff format option when format is unified" do
0
options = parse(["--diff", "unified"])
0
options.diff_format.should == :unified
0
options.differ_class.should equal(Spec::Expectations::Differs::Default)
0
it "should use context diff format option when format is context" do
0
options = parse(["--diff", "context"])
0
options.diff_format.should == :context
0
options.differ_class.should == Spec::Expectations::Differs::Default
0
it "should use custom diff format option when format is a custom format" do
0
Spec::Expectations.differ.should_not be_instance_of(Custom::Differ)
0
options = parse(["--diff", "Custom::Differ"])
0
options.parse_diff "Custom::Differ"
0
options.diff_format.should == :custom
0
options.differ_class.should == Custom::Differ
0
Spec::Expectations.differ.should be_instance_of(Custom::Differ)
0
it "should print instructions about how to fix missing differ" do
0
lambda { parse(["--diff", "Custom::MissingFormatter"]) }.should raise_error(NameError)
0
@err.string.should match(/Couldn't find differ class Custom::MissingFormatter/n)
0
describe "when attempting a focussed spec" do
0
attr_reader :file, :dir
0
@@ -226,18 +226,18 @@ describe "OptionParser" do
0
@file = "#{File.dirname(__FILE__)}/spec_parser/spec_parser_fixture.rb"
0
@dir = File.dirname(file)
0
$rspec_options = @original_rspec_options
0
$rspec_options = options
0
options.filename_pattern = "*_fixture.rb"
0
it "should support --line to identify spec" do
0
options = parse([file, "--line", "13"])
0
options.line_number.should == 13
0
@@ -245,34 +245,34 @@ describe "OptionParser&qu