spec/renum_spec.rb in renum-0.0.3 vs spec/renum_spec.rb in renum-0.1.0

- old
+ new

@@ -1,7 +1,12 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper.rb') -require File.expand_path(File.dirname(__FILE__) + '/../lib/renum') +if ENV['USE_GEM'] + require 'rubygems' + require 'renum' +else + require File.expand_path(File.dirname(__FILE__) + '/../lib/renum') +end enum :Status, [ :NOT_STARTED, :IN_PROGRESS, :COMPLETE ] enum :Color, [ :RED, :GREEN, :BLUE ] do def abbr @@ -14,14 +19,14 @@ end describe "enum" do it "creates a class for the value type" do - Status.class.should == Class + Status.should be_an_instance_of(Class) end it "makes each value an instance of the value type" do - Status::NOT_STARTED.class.should == Status + Status::NOT_STARTED.should be_an_instance_of(Status) end it "exposes array of values" do Status.values.should == [Status::NOT_STARTED, Status::IN_PROGRESS, Status::COMPLETE] end \ No newline at end of file