Sha256: 151eeeb9cc6ff9597911b2570f95e1a3191271a1271225cb010db97b2f3d724e

Contents?: true

Size: 725 Bytes

Versions: 4

Compression:

Stored size: 725 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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mspec-1.0.0 spec/helpers/io_spec.rb
mspec-1.1.1 spec/helpers/io_spec.rb
mspec-1.1.0 spec/helpers/io_spec.rb
mspec-1.2.0 spec/helpers/io_spec.rb