Skip to content

Commit

Permalink
Fixed the attributes spec dummy service class definition so that it w…
Browse files Browse the repository at this point in the history
…orks in Ruby 1.9.1.
  • Loading branch information
laserlemon authored and binarylogic committed Aug 21, 2010
1 parent 9179321 commit ad8f7d4
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions spec/attributes_spec.rb
@@ -1,20 +1,18 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Service Attributes" do
before(:all) do
class Service
ATTRIBUTE_TYPES = %w(array integer float decimal boolean string text datetime)

include Shippinglogic::Attributes

ATTRIBUTE_TYPES.each do |type|
attribute :"#{type}_without_default", type
attribute :"#{type}_with_default_value", type, :default => 1
attribute :"#{type}_with_default_proc", type, :default => lambda{ Time.now }
end
end
end
class Service
ATTRIBUTE_TYPES = %w(array integer float decimal boolean string text datetime)

include Shippinglogic::Attributes

ATTRIBUTE_TYPES.each do |type|
attribute :"#{type}_without_default", type
attribute :"#{type}_with_default_value", type, :default => 1
attribute :"#{type}_with_default_proc", type, :default => lambda{|s| Time.now }
end
end

describe "Service Attributes" do
after(:all) do
Object.send(:remove_const, :Service)
end
Expand Down

0 comments on commit ad8f7d4

Please sign in to comment.