Sha256: c9e3b0268d1c051ba3dce10829c16d5e07878cc98d879bec0933eaaa9fb70a08

Contents?: true

Size: 892 Bytes

Versions: 4

Compression:

Stored size: 892 Bytes

Contents

require 'stringio'
context "CommandLine" do
  specify "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 =~ /60 specifications, 0 failures/n
  end

  specify "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 specifications, 0 failures/n
  end

  specify "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
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/runner/command_line_spec.rb
rspec-0.8.0 spec/spec/runner/command_line_spec.rb
rspec-0.8.1 spec/spec/runner/command_line_spec.rb
rspec-0.8.2 spec/spec/runner/command_line_spec.rb