Sha256: f97eced702f3f0dd791ca116f0a75e365729ad98bcdd09e13d56740bbcded662

Contents?: true

Size: 282 Bytes

Versions: 3

Compression:

Stored size: 282 Bytes

Contents

require 'spec_helper'

class Mike
  include Id::Model

  field :cat
  field :dog, :optional => true

  def catdog
    dog.value_or cat
  end

end

describe "Foobar" do
  let (:mike) { Mike.new(:cat => 'pooface') }
  it 'returns cat' do
    mike.catdog.should eq 'pooface'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
id-0.0.12 spec/lib/mike_spec.rb
id-0.0.11 spec/lib/mike_spec.rb
id-0.0.10 spec/lib/mike_spec.rb