Sha256: 52a6df2198501cfb5660d8bdb3a760d566a19073ccbb4634bf63fb8eab07b25b

Contents?: true

Size: 676 Bytes

Versions: 17

Compression:

Stored size: 676 Bytes

Contents

require "spec_helper"
require "shamu/attributes"

describe Shamu::Attributes::FluidAssignment do
  let( :klass ) do
    Class.new do
      include Shamu::Attributes
      include Shamu::Attributes::Assignment
      include Shamu::Attributes::FluidAssignment

      attribute :value
    end
  end

  it "returns the current value with no arguments" do
    instance = klass.new( value: "one" )

    expect( instance.value ).to eq "one"
  end

  it "assigns the value when arguments present" do
    instance = klass.new
    instance.value( "two" )
  end

  it "return self on assignment" do
    instance = klass.new
    expect( instance.value( "two" ) ).to be instance
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shamu-0.0.24 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.21 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.20 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.19 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.18 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.17 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.15 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.14 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.13 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.11 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.9 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.8 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.7 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.5 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.4 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.3 spec/lib/shamu/attributes/fluid_assignment_spec.rb
shamu-0.0.2 spec/lib/shamu/attributes/fluid_assignment_spec.rb