Sha256: e347ba2e5cbec1d2c0dc5d047601b7a4b117a89f67b3c4927aea4175bea1087e

Contents?: true

Size: 942 Bytes

Versions: 22

Compression:

Stored size: 942 Bytes

Contents

require 'spec_helper'

describe TablePrint::Returnable do
  it "returns its initialized value from its to_s method" do
    r = TablePrint::Returnable.new("foobar")
    r.to_s.should == "foobar"
  end

  it "returns its initialized value from its inspect method" do
    # 1.8.7 calls inspect on return values
    r = TablePrint::Returnable.new("foobar")
    r.inspect.should == "foobar"
  end

  it "passes #set through to TablePrint::Config" do
    TablePrint::Config.should_receive(:set).with(Object, [:foo])
    r = TablePrint::Returnable.new
    r.set(Object, :foo)
  end

  it "passes #clear through to TablePrint::Config" do
    TablePrint::Config.should_receive(:clear).with(Object)
    r = TablePrint::Returnable.new
    r.clear(Object)
  end

  it "passes #config_for through to TablePrint::Config.for" do
    TablePrint::Config.should_receive(:for).with(Object)
    r = TablePrint::Returnable.new
    r.config_for(Object)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
table_print-1.5.7 spec/returnable_spec.rb
table_print-1.5.6 spec/returnable_spec.rb
table_print-1.5.5 spec/returnable_spec.rb
table_print-1.5.4 spec/returnable_spec.rb
table_print-1.5.3 spec/returnable_spec.rb
table_print-1.5.2 spec/returnable_spec.rb
table_print-1.5.1 spec/returnable_spec.rb
table_print-1.5.0 spec/returnable_spec.rb
table_print-1.4.1 spec/returnable_spec.rb
table_print-1.4.0 spec/returnable_spec.rb
table_print-1.3.3 spec/returnable_spec.rb
table_print-1.3.2 spec/returnable_spec.rb
table_print-1.3.1 spec/returnable_spec.rb
table_print-1.3.0 spec/returnable_spec.rb
table_print-1.2.0 spec/returnable_spec.rb
table_print-1.1.5 spec/returnable_spec.rb
table_print-1.1.4 spec/returnable_spec.rb
table_print-1.1.3 spec/returnable_spec.rb
table_print-1.1.2 spec/returnable_spec.rb
table_print-1.1.1 spec/returnable_spec.rb