gorp 0.19.2 → 0.20.0

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.
Files changed (4) hide show
  1. data/gorp.gemspec +1 -1
  2. data/lib/gorp/test.rb +33 -24
  3. data/lib/version.rb +2 -2
  4. metadata +1 -1
data/gorp.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{gorp}
5
- s.version = "0.19.2"
5
+ s.version = "0.20.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sam Ruby"]
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 < ActiveSupport::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
@@ -1,8 +1,8 @@
1
1
  module Gorp
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 19
5
- TINY = 2
4
+ MINOR = 20
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.2
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby