Sha256: f9aec1fb82d32756dc3741b4409b1096bea6ef64a0027810fd734849f667da65

Contents?: true

Size: 918 Bytes

Versions: 3

Compression:

Stored size: 918 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'
require File.dirname(__FILE__) + '/resources/custom_example_group_runner'

describe Spec::Runner::OptionsExtensions do

  before(:each) do
    @out = StringIO.new
    @err = StringIO.new
    @parser = Spec::Runner::OptionParser.new(@err, @out)
  end

  def parse(args)
    @parser.parse(args)
    @parser.options
  end  

  it "should add a story_formatters method to the options" do
    parse([]).should respond_to(:story_formatters)
  end
    
  it "should use html story formatter when format is h" do
    options = parse(["--format", "h"])
    options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
  end

  it "should use html story formatter when format is html" do
    options = parse(["--format", "html"])
    options.story_formatters[0].class.should equal(Spec::Runner::Formatter::Story::HtmlFormatter)
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
dchelimsky-rspec-stories-1.0.0 spec/spec/runner/options_extensions_spec.rb
samstokes-rspec-stories-1.0.1 spec/spec/runner/options_extensions_spec.rb
samstokes-rspec-stories-1.0.2 spec/spec/runner/options_extensions_spec.rb