Sha256: abaaf2c5d4abe4a036ee528156d98ffd75873a54c25844272c26121e7ecfa710

Contents?: true

Size: 919 Bytes

Versions: 9

Compression:

Stored size: 919 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 =~ /77 examples, 0 failures/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

9 entries across 9 versions & 2 rubygems

Version Path
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb
rspec-1.0.0 spec/spec/runner/command_line_spec.rb
rspec-1.0.1 spec/spec/runner/command_line_spec.rb
rspec-1.0.2 spec/spec/runner/command_line_spec.rb
rspec-1.0.3 spec/spec/runner/command_line_spec.rb
rspec-1.0.4 spec/spec/runner/command_line_spec.rb
rspec-1.0.5 spec/spec/runner/command_line_spec.rb