Sha256: 1a28280d7de4546bc7f586d4f05946b647aaf56cdfac0c633b1056de2c296f94
Contents?: true
Size: 598 Bytes
Versions: 3
Compression:
Stored size: 598 Bytes
Contents
require 'spec_helper' feature "Definition" do class Foo def say "Hey!" end end class FooDecorator < RDecorator::Base def say origin.say * 3 end end class This def say "Yeah!" end end class ThatDecorator < RDecorator::Base decorate_for :this def say origin.say * 3 end end scenario "Auto decoration by class-name" do foo = Foo.new foo.decorated.say.should eq "Hey!Hey!Hey!" end scenario "using 'decorate_for'" do this = This.new this.decorated.say.should eq "Yeah!Yeah!Yeah!" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
r_decorator-0.0.3 | spec/decorators/definition_spec.rb |
r_decorator-0.0.2 | spec/features/decorator_spec.rb |
r_decorator-0.0.1 | spec/features/decorator_spec.rb |