File: returnable_spec.rb

package info (click to toggle)
ruby-table-print 1.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 292 kB
  • sloc: ruby: 1,821; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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