citrusbyte-contest 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/rails/init.rb +27 -0
- metadata +2 -1
data/rails/init.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# ActiveStupor defines its own idiom for the class-level setup method
|
2
|
+
# (using callback chains). This hack is to ensure that Contest users can
|
3
|
+
# still call the setup method with a block.
|
4
|
+
if RAILS_ENV == 'test'
|
5
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'contest')
|
6
|
+
require "active_support/test_case"
|
7
|
+
|
8
|
+
class Test::Unit::TestCase
|
9
|
+
class << self
|
10
|
+
alias contest_setup setup
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class ActiveSupport::TestCase
|
15
|
+
class << self
|
16
|
+
alias activesupport_setup setup
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.setup(*args, &block)
|
20
|
+
if args.empty?
|
21
|
+
contest_setup(&block)
|
22
|
+
else
|
23
|
+
activesupport_setup(*args)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: citrusbyte-contest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Janowski
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- README.markdown
|
28
28
|
- LICENSE
|
29
29
|
- Rakefile
|
30
|
+
- rails/init.rb
|
30
31
|
- test/all_test.rb
|
31
32
|
has_rdoc: false
|
32
33
|
homepage: http://github.com/citrusbyte/contest
|