gorp 0.19.2 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- data/gorp.gemspec +1 -1
- data/lib/gorp/test.rb +33 -24
- data/lib/version.rb +2 -2
- metadata +1 -1
data/gorp.gemspec
CHANGED
data/lib/gorp/test.rb
CHANGED
@@ -5,29 +5,6 @@ require 'gorp/edit'
|
|
5
5
|
require 'gorp/rails'
|
6
6
|
require 'gorp/commands'
|
7
7
|
|
8
|
-
if File.exist? "#{$WORK}/vendor/gems/environment.rb"
|
9
|
-
require "#{$WORK}/vendor/gems/environment.rb"
|
10
|
-
end
|
11
|
-
|
12
|
-
require 'active_support'
|
13
|
-
require 'active_support/version'
|
14
|
-
require 'active_support/test_case'
|
15
|
-
|
16
|
-
# just enough infrastructure to get 'assert_select' to work
|
17
|
-
require 'action_controller'
|
18
|
-
begin
|
19
|
-
# Rails (2.3.3 ish)
|
20
|
-
require 'action_controller/assertions/selector_assertions'
|
21
|
-
include ActionController::Assertions::SelectorAssertions
|
22
|
-
rescue LoadError
|
23
|
-
# Rails (3.0 ish)
|
24
|
-
require 'action_dispatch/testing/assertions'
|
25
|
-
require 'action_dispatch/testing/assertions/selector'
|
26
|
-
include ActionDispatch::Assertions::SelectorAssertions
|
27
|
-
end
|
28
|
-
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
29
|
-
require 'action_controller/vendor/html-scanner/html/document'
|
30
|
-
|
31
8
|
module Gorp
|
32
9
|
class BuilderTee < BlankSlate
|
33
10
|
def initialize(one, two)
|
@@ -49,7 +26,39 @@ module Gorp
|
|
49
26
|
end
|
50
27
|
end
|
51
28
|
|
52
|
-
class Gorp::TestCase <
|
29
|
+
class Gorp::TestCase < Test::Unit::TestCase
|
30
|
+
|
31
|
+
def self.suite
|
32
|
+
# Deferred loading of Rails infrastructure
|
33
|
+
if File.exist? "#{$WORK}/vendor/gems/environment.rb"
|
34
|
+
require "#{$WORK}/vendor/gems/environment.rb"
|
35
|
+
end
|
36
|
+
|
37
|
+
require 'active_support'
|
38
|
+
require 'active_support/version'
|
39
|
+
require 'active_support/test_case'
|
40
|
+
|
41
|
+
# just enough infrastructure to get 'assert_select' to work
|
42
|
+
require 'action_controller'
|
43
|
+
begin
|
44
|
+
# Rails (2.3.3 ish)
|
45
|
+
require 'action_controller/assertions/selector_assertions'
|
46
|
+
include ActionController::Assertions::SelectorAssertions
|
47
|
+
rescue LoadError
|
48
|
+
# Rails (3.0 ish)
|
49
|
+
require 'action_dispatch/testing/assertions'
|
50
|
+
require 'action_dispatch/testing/assertions/selector'
|
51
|
+
include ActionDispatch::Assertions::SelectorAssertions
|
52
|
+
end
|
53
|
+
|
54
|
+
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
55
|
+
require 'action_controller/vendor/html-scanner/html/document'
|
56
|
+
super
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.test(name, &block)
|
60
|
+
define_method("test_#{name.gsub(/\s+/,'_')}".to_sym, &block)
|
61
|
+
end
|
53
62
|
|
54
63
|
# micro DSL allowing the definition of optional tests
|
55
64
|
def self.section number, title, &tests
|
data/lib/version.rb
CHANGED