Sha256: 9c69b2d85ba2ad4d460884f067fbcc0dd93e69b39c5290f77e54391dbed7eca8

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

require 'spec_helper'

describe Ripple::Document::Key do
  require 'support/models/box'
  before do
    @box = Box.new
  end
  
  it "should define key getter and setter" do
    @box.should respond_to(:key)
    @box.should respond_to(:key=)
  end

  it "should stringify the assigned key" do
    @box.key = 2
    @box.key.should == "2"
  end

  it "should use a property as the key" do
    class ShapedBox < Box
      key_on :shape
    end
    @box = ShapedBox.new
    @box.key = "square"
    @box.key.should == "square"
    @box.shape.should == "square"
    @box.shape = "oblong"
    @box.key.should == "oblong"
  end  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
seomoz-ripple-1.0.0.pre spec/ripple/key_spec.rb