Skip to content
Browse files

test on rails 32

  • Loading branch information...
1 parent b0932c2 commit 7803cf56cf1825714dbcc153b6d982f73c706e31 @grosser grosser committed Jun 13, 2013
Showing with 137 additions and 3 deletions.
  1. +5 −0 Appraisals
  2. +18 −0 gemfiles/rails32.gemfile
  3. +99 −0 gemfiles/rails32.gemfile.lock
  4. +10 −2 lib/call_center/test/dsl.rb
  5. +5 −1 lib/call_center/test/minitest/dsl.rb
View
5 Appraisals
@@ -5,3 +5,8 @@ end
appraise "rails30" do
gem 'actionpack', "3.0.20"
end
+
+appraise "rails32" do
+ gem 'actionpack', "3.2.13"
+end
+
View
18 gemfiles/rails32.gemfile
@@ -0,0 +1,18 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "shoulda"
+gem "rcov"
+gem "guard"
+gem "guard-test"
+gem "mocha"
+gem "bourne", ">= 1.2.0"
+gem "minitest", "~> 3.3.0"
+gem "minitest-reporters", :platform=>:ruby_19
+gem "guard-shell"
+gem "appraisal"
+gem "bump"
+gem "actionpack", "3.2.13"
+
+gemspec :path=>"../"
View
99 gemfiles/rails32.gemfile.lock
@@ -0,0 +1,99 @@
+PATH
+ remote: ../
+ specs:
+ call_center (1.0.2)
+ builder
+ hsume2-state_machine (~> 1.0.5)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionpack (3.2.13)
+ activemodel (= 3.2.13)
+ activesupport (= 3.2.13)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.5)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.13)
+ activesupport (= 3.2.13)
+ builder (~> 3.0.0)
+ activesupport (3.2.13)
+ i18n (= 0.6.1)
+ multi_json (~> 1.0)
+ ansi (1.4.3)
+ appraisal (0.5.2)
+ bundler
+ rake
+ bourne (1.4.0)
+ mocha (~> 0.13.2)
+ builder (3.0.4)
+ bump (0.4.2)
+ erubis (2.7.0)
+ guard (0.7.0)
+ thor (~> 0.14.6)
+ guard-shell (0.1.1)
+ guard (>= 0.2.0)
+ guard-test (0.3.0)
+ guard (>= 0.2.2)
+ test-unit (~> 2.2)
+ hashie (2.0.5)
+ hike (1.2.3)
+ hsume2-state_machine (1.0.5)
+ i18n (0.6.1)
+ journey (1.0.4)
+ metaclass (0.0.1)
+ minitest (3.3.0)
+ minitest-reporters (0.14.20)
+ ansi
+ builder
+ minitest (>= 2.12, < 5.0)
+ powerbar
+ mocha (0.13.3)
+ metaclass (~> 0.0.1)
+ multi_json (1.7.6)
+ powerbar (1.0.11)
+ ansi (~> 1.4.0)
+ hashie (>= 1.1.0)
+ rack (1.4.5)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rake (10.0.4)
+ rcov (0.9.9)
+ shoulda (3.5.0)
+ shoulda-context (~> 1.0, >= 1.0.1)
+ shoulda-matchers (>= 1.4.1, < 3.0)
+ shoulda-context (1.1.2)
+ shoulda-matchers (2.1.0)
+ activesupport (>= 3.0.0)
+ sprockets (2.2.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ test-unit (2.5.5)
+ thor (0.14.6)
+ tilt (1.4.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (= 3.2.13)
+ appraisal
+ bourne (>= 1.2.0)
+ bump
+ call_center!
+ guard
+ guard-shell
+ guard-test
+ minitest (~> 3.3.0)
+ minitest-reporters
+ mocha
+ rcov
+ shoulda
View
12 lib/call_center/test/dsl.rb
@@ -3,7 +3,11 @@
if ActionPack::VERSION::MAJOR == 2
require 'action_controller/assertions/selector_assertions'
else
- require 'action_dispatch/testing/assertions/selector'
+ if ActionPack::VERSION::MINOR == 0
+ require 'action_dispatch/testing/assertions/selector'
+ else
+ require 'action_dispatch/testing/assertions'
+ end
end
module CallCenter
@@ -18,8 +22,12 @@ def self.included(base)
base.extend(ClassMethods)
base.class_eval do
+ def html_document
+ HTML::Document.new(CGI.unescapeHTML(@body))
+ end
+
def response_from_page_or_rjs_with_body
- HTML::Document.new(CGI.unescapeHTML(@body)).root
+ html_document.root
end
alias_method_chain :response_from_page_or_rjs, :body
end
View
6 lib/call_center/test/minitest/dsl.rb
@@ -256,14 +256,18 @@ def stub_branches(object)
end
def response_from_page_or_rjs
- HTML::Document.new(@_body).root
+ html_document.root
end
def body(text, debug = false)
puts text if debug
@_body = text
end
+ def html_document
+ HTML::Document.new(@_body)
+ end
+
private
def build_message(head, template=nil, *arguments)

0 comments on commit 7803cf5

Please sign in to comment.
Something went wrong with that request. Please try again.