Sha256: 8e6e614cb2a23a46de4ec1510098216460cee4f540864af897e37bdc880275b6

Contents?: true

Size: 873 Bytes

Versions: 5

Compression:

Stored size: 873 Bytes

Contents

require 'stringio'
describe "CommandLine" do
  it "should run directory" do
    file = File.dirname(__FILE__) + '/../../../examples'
    err = StringIO.new
    out = StringIO.new
    Spec::Runner::CommandLine.run([file], err, out, false, true)
    
    out.rewind
    out.read.should =~ /74 examples, 0 failures/n
  end

  it "should run file" do
    file = File.dirname(__FILE__) + '/../../../examples/io_processor_spec.rb'
    err = StringIO.new
    out = StringIO.new
    Spec::Runner::CommandLine.run([file], err, out, false, true)
    
    out.rewind
    out.read.should =~ /2 examples, 0 failures/n
  end

  it "should raise when file does not exist" do
    file = File.dirname(__FILE__) + '/doesntexist'
    err = StringIO.new
    out = StringIO.new

    lambda {
      Spec::Runner::CommandLine.run([file], err, out, false, true)
    }.should raise_error
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-0.9.0 spec/spec/runner/command_line_spec.rb
rspec-0.9.1 spec/spec/runner/command_line_spec.rb
rspec-0.9.2 spec/spec/runner/command_line_spec.rb
rspec-0.9.3 spec/spec/runner/command_line_spec.rb
rspec-0.9.4 spec/spec/runner/command_line_spec.rb