Sha256: ea7aab3ea215185954ac12a9bd63169418dc2b18e3baf330ac7024d472ec7654

Contents?: true

Size: 408 Bytes

Versions: 14

Compression:

Stored size: 408 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Bulk enum definitions" do

  it 'define enum constants using block' do
    ActiveEnum.define do
      enum(:foo) do
        value :id => 1, :name => 'Foo 1'
      end

      enum(:bar) do
        value :id => 1, :name => 'Bar 1'
      end
    end

    Foo.all.should == [[1,'Foo 1']]
    Bar.all.should == [[1,'Bar 1']]
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
active_enum-0.6.6 spec/active_enum_spec.rb
active_enum-0.7.1 spec/active_enum_spec.rb
active_enum-0.7.0 spec/active_enum_spec.rb
active_enum-0.6.5 spec/active_enum_spec.rb
active_enum-0.6.4 spec/active_enum_spec.rb
active_enum-0.6.3 spec/active_enum_spec.rb
active_enum-0.6.2 spec/active_enum_spec.rb
active_enum-0.6.1 spec/active_enum_spec.rb
active_enum-0.6.0 spec/active_enum_spec.rb
active_enum-0.5.1 spec/active_enum_spec.rb
active_enum-0.5.0 spec/active_enum_spec.rb
active_enum-0.4.1 spec/active_enum_spec.rb
active_enum-0.4.0 spec/active_enum_spec.rb
active_enum-0.3.0 spec/active_enum_spec.rb