Sha256: c2e92d68262b1e9f31d71f83eeb153d782f38224eaf1dc9266f9de8bf80bd9c4

Contents?: true

Size: 831 Bytes

Versions: 15

Compression:

Stored size: 831 Bytes

Contents

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

describe IOStub do
  before :each do
    @out = IOStub.new
    @sep = $\
  end

  after :each do
    $\ = @sep
  end

  it "provides a write method" do
    @out.write "this"
    @out.should == "this"
  end

  it "concatenates the arguments sent to write" do
    @out.write "flim ", "flam"
    @out.should == "flim flam"
  end

  it "provides a print method that appends the default separator" do
    $\ = " [newline] "
    @out.print "hello"
    @out.print "world"
    @out.should == "hello [newline] world [newline] "
  end

  it "provides a puts method that appends the default separator" do
    @out.puts "hello", 1, 2, 3
    @out.should == "hello\n1\n2\n3\n"
  end

  it "provides a flush method that does nothing and returns self" do
    @out.flush.should == @out
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mspec-1.5.1 spec/helpers/io_spec.rb
mspec-1.3.1 spec/helpers/io_spec.rb
mspec-1.5.0 spec/helpers/io_spec.rb
mspec-1.5.2 spec/helpers/io_spec.rb
mspec-1.5.3 spec/helpers/io_spec.rb
mspec-1.5.4 spec/helpers/io_spec.rb
mspec-1.4.0 spec/helpers/io_spec.rb
mspec-1.5.11 spec/helpers/io_spec.rb
mspec-1.5.10 spec/helpers/io_spec.rb
mspec-1.3.0 spec/helpers/io_spec.rb
mspec-1.5.6 spec/helpers/io_spec.rb
mspec-1.5.7 spec/helpers/io_spec.rb
mspec-1.5.8 spec/helpers/io_spec.rb
mspec-1.5.5 spec/helpers/io_spec.rb
mspec-1.5.9 spec/helpers/io_spec.rb