Sha256: ddd8a2ca1d2d27b1fdfdb0ec6dfde20f63e2e593c430277916744154c3763bbe
Contents?: true
Size: 1.06 KB
Versions: 3
Compression:
Stored size: 1.06 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') class ClassyEnumConversion < ClassyEnum::Base end class ClassyEnumConversion::One < ClassyEnumConversion end class ClassyEnumConversion::Two < ClassyEnumConversion end describe ClassyEnum::Conversion do context '#to_i' do specify { ClassyEnumConversion::One.new.to_i.should == 1 } specify { ClassyEnumConversion::Two.new.to_i.should == 2 } end context '#index' do specify { ClassyEnumConversion::One.new.index.should == 1 } specify { ClassyEnumConversion::Two.new.index.should == 2 } end context '#to_s' do specify { ClassyEnumConversion::One.new.to_s.should == 'one' } specify { ClassyEnumConversion::Two.new.to_s.should == 'two' } end context '#to_sym' do specify { ClassyEnumConversion::One.new.to_sym.should == :one } specify { ClassyEnumConversion::Two.new.to_sym.should == :two } end context '#as_json' do specify { ClassyEnumConversion::One.new.as_json.should == 'one' } specify { ClassyEnumConversion::Two.new.as_json.should == 'two' } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
classy_enum-4.0.1.beta1 | spec/classy_enum/conversion_spec.rb |
classy_enum-4.0.0 | spec/classy_enum/conversion_spec.rb |
classy_enum-4.0.0.beta1 | spec/classy_enum/conversion_spec.rb |