Sha256: bd0e6c2898a955e732ea890778df3a38ef794a47d3d13703836dc86a4eaa52af

Contents?: true

Size: 635 Bytes

Versions: 4

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

Comic = Struct.new(:title, :price)

module ComicPresenter
  def price
    "$#{super}"
  end
end

describe ActiveDecorator::Configuration do
  let(:comic) { ActiveDecorator::Decorator.instance.decorate(Comic.new("amatsuda's (Poignant) Guide to ActiveDecorator", 3)) }

  context 'with a custom decorator_suffix' do
    before do
      ActiveDecorator.configure do |config|
        config.decorator_suffix = 'Presenter'
      end
    end

    after do
      ActiveDecorator.configure do |config|
        config.decorator_suffix = 'Decorator'
      end
    end

    specify { comic.price.should == '$3' }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_decorator-0.5.3 spec/configuration_spec.rb
active_decorator-0.5.2 spec/configuration_spec.rb
active_decorator-0.5.1 spec/configuration_spec.rb
active_decorator-0.5.0 spec/configuration_spec.rb