Sha256: 3e2183e4b29d26dd743c04abc611deadfbef858636c0973534711392c2e8dec4

Contents?: true

Size: 670 Bytes

Versions: 16

Compression:

Stored size: 670 Bytes

Contents

$: << File.dirname(__FILE__) + '/../lib/'
require 'test/spec'
require 'test/spec/should-output'

context "should.output" do
  specify "works for print" do
    lambda { print "foo" }.should.output "foo"
    lambda { print "foo" }.should.output(/oo/)
  end

  specify "works for puts" do
    lambda { puts "foo" }.should.output "foo\n"
    lambda { puts "foo" }.should.output(/foo/)
  end

  specify "works with readline" do
    lambda { require 'readline' }.should.not.raise(LoadError)
    lambda { puts "foo" }.should.output "foo\n"
    lambda { puts "foo" }.should.output(/foo/)

    File.should.not.exist(File.join(Dir.tmpdir, "should_output_#{$$}"))
  end
end

  
  

Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
jordi-xml_struct-0.1.3 test/vendor/test-spec/test/spec_should-output.rb
jordi-xml_struct-0.2.0 test/vendor/test-spec/test/spec_should-output.rb
jordi-xml_struct-0.2.1 test/vendor/test-spec/test/spec_should-output.rb
nullstyle-test-spec-0.4.1 test/spec_should-output.rb
relevance-test-spec-0.4.0.5 test/spec_should-output.rb
relevance-test-spec-0.4.1.1 test/spec_should-output.rb
relevance-test-spec-0.4.1.2 test/spec_should-output.rb
relevance-test-spec-0.4.1 test/spec_should-output.rb
mofo-0.1.2 vendor/testspec-0.3.0/test/spec_should-output.rb
mofo-0.2.2 vendor/testspec-0.3.0/test/spec_should-output.rb
mofo-0.2.1 vendor/testspec-0.3.0/test/spec_should-output.rb
mofo-0.2 vendor/testspec-0.3.0/test/spec_should-output.rb
test-spec-0.3.0 test/spec_should-output.rb
test-spec-0.9.0 test/spec_should-output.rb
test-spec-0.10.0 test/spec_should-output.rb
test-spec-0.4.0 test/spec_should-output.rb