Sha256: 107bd7b55a4f47f45451fe04b36872bdd62956b4b82d44b21cd1ac28be914a81

Contents?: true

Size: 672 Bytes

Versions: 12

Compression:

Stored size: 672 Bytes

Contents

# ActiveStupor defines its own idiom for the class-level setup method
# (using callback chains). This hack is to ensure that Contest users can
# still call the setup method with a block.
if RAILS_ENV == 'test'
  require File.join(File.dirname(__FILE__), '..', 'lib', 'contest')
  require "active_support/test_case"
  
  class Test::Unit::TestCase
    class << self
      alias contest_setup setup
    end
  end
  
  class ActiveSupport::TestCase
    class << self
      alias activesupport_setup setup
    end
  
    def self.setup(*args, &block)
      if args.empty?
        contest_setup(&block)
      else
        activesupport_setup(*args)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
citrusbyte-contest-0.0.7 rails/init.rb
citrusbyte-contest-0.0.8 rails/init.rb
citrusbyte-contest-0.0.9 rails/init.rb
citrusbyte-contest-0.1.0 rails/init.rb
citrusbyte-contest-0.1.1 rails/init.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/contest-0.1.3/rails/init.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/contest-0.1.3/rails/init.rb
contest-0.1.3 rails/init.rb
mjfreshyfresh-contest-0.0.1 rails/init.rb
mcmire-contest-0.1.3 rails/init.rb
contest-0.1.2 rails/init.rb
contest-0.1.1 rails/init.rb