Sha256: 7f1c1607d56b17b3a3d267fcb409f33a073b331f2e5f1549dd200269f18bb04a

Contents?: true

Size: 640 Bytes

Versions: 7

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

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

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

class ConfigurationTest < Test::Unit::TestCase
  test 'with a custom decorator_suffix' do
    begin
      ActiveDecorator.configure do |config|
        config.decorator_suffix = 'Presenter'
      end

      comic = ActiveDecorator::Decorator.instance.decorate Comic.new("amatsuda's (Poignant) Guide to ActiveDecorator", 3)
      assert_equal '$3', comic.price
    ensure
      ActiveDecorator.configure do |config|
        config.decorator_suffix = 'Decorator'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_decorator-1.3.3 test/configuration_test.rb
active_decorator-1.3.2 test/configuration_test.rb
active_decorator-1.3.1 test/configuration_test.rb
active_decorator-1.3.0 test/configuration_test.rb
active_decorator-1.2.0 test/configuration_test.rb
active_decorator-1.1.1 test/configuration_test.rb
active_decorator-1.1.0 test/configuration_test.rb