Sha256: ee453793c0c8470a985248742dca4c75b838498e2f2749cae2c488988b6fccf3

Contents?: true

Size: 930 Bytes

Versions: 3

Compression:

Stored size: 930 Bytes

Contents

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

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 =~ /78 examples, 0 failures, 3 pending/n
  end

  it "should run file" do
    file = File.dirname(__FILE__) + '/../../../failing_examples/predicate_example.rb'
    err = StringIO.new
    out = StringIO.new
    Spec::Runner::CommandLine.run([file], err, out, false, true)
    
    out.rewind
    out.read.should =~ /2 examples, 1 failure/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

3 entries across 3 versions & 1 rubygems

Version Path
rspec-1.0.6 spec/spec/runner/command_line_spec.rb
rspec-1.0.7 spec/spec/runner/command_line_spec.rb
rspec-1.0.8 spec/spec/runner/command_line_spec.rb