Sha256: f03f8f6e7e142d3da284726e9df17688931e335a41eda1310f4477cbdc0e2b79

Contents?: true

Size: 696 Bytes

Versions: 4

Compression:

Stored size: 696 Bytes

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')

describe AttributeChain do
  before :all do
    class Foo
      include AttributeChain
      attr_chain :spec
    end
    
    @instance = Foo.new
  end
  
  it "should respond to :attr_chain" do
    Foo.should respond_to(:attr_chain)
  end
  
  it "should have a method for :spec" do
    @instance.should respond_to(:spec)
  end
  
  it "should allow setting :spec" do
    @instance.spec("aye")
  end
  
  it "should be set" do
    @instance.spec("aye")
    @instance.spec.should == "aye"
  end
  
  it "should return an instance of the Foo class after setting :spec" do
    @instance.spec("aye").should be_an_instance_of(Foo)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
benschwarz-attr-chain-0.1.0 spec/attr_method_spec.rb
benschwarz-attr-chain-0.1.1 spec/attr_method_spec.rb
benschwarz-attr-chain-0.1.2 spec/attr_method_spec.rb
attr-chain-0.1.2 spec/attr_method_spec.rb