Sha256: 9308c22be517aa397e800019913bf0701af5c4d3aa8ed571abc0296b6adb7cee

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

require 'draper/test/view_context'

module MiniTest
  class Spec
    class Decorator < Spec
      before { Draper::ViewContext.infect!(self) }
    end
  end
end

class MiniTest::Unit::DecoratorTestCase < MiniTest::Unit::TestCase
  if method_defined?(:before_setup)
    # for minitext >= 2.11
    def before_setup
      super
      Draper::ViewContext.infect!(self)
    end
  else
    # for older minitest, like what ships w/Ruby 1.9
    add_setup_hook { Draper::ViewContext.infect!(self) }
  end
end

MiniTest::Spec.register_spec_type(MiniTest::Spec::Decorator) do |desc|
  desc.superclass == Draper::Base
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
draper-0.17.0 lib/draper/test/minitest_integration.rb
draper-0.16.0 lib/draper/test/minitest_integration.rb