Skip to content

Commit

Permalink
Merge pull request padrino#1212 from sshaw/master
Browse files Browse the repository at this point in the history
Some fixes for Test::Unit/Shoulda/RR test cases
  • Loading branch information
nesquena committed Apr 1, 2013
2 parents 81fc7fe + e2ae1e5 commit 3c4f995
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Expand Up @@ -8,6 +8,6 @@ def setup_mock
when 'minitest'
insert_mocking_include "RR::Adapters::MiniTest", :path => "test/test_config.rb"
else # default include
insert_mocking_include "RR::Adapters::RRMethods", :path => "test/test_config.rb"
insert_mocking_include "RR::Adapters::TestUnit", :path => "test/test_config.rb"
end
end
Expand Up @@ -2,6 +2,8 @@
PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
require "test/unit"
class Test::Unit::TestCase
include Rack::Test::Methods
Expand Down Expand Up @@ -63,9 +65,6 @@ def setup_test
require_dependencies 'rack-test', :require => 'rack/test', :group => 'test'
require_dependencies 'shoulda', :group => 'test'
insert_test_suite_setup SHOULDA_SETUP
if options[:orm] == "activerecord"
inject_into_file destination_root("test/test_config.rb"), "require 'shoulda/active_record'\n\n", :before => /class.*?\n/
end
create_file destination_root("test/test.rake"), SHOULDA_RAKE
end

Expand Down
2 changes: 1 addition & 1 deletion padrino-gen/test/test_project_generator.rb
Expand Up @@ -176,7 +176,7 @@ def teardown
out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--mock=rr', '--test=bacon', '--script=none') }
assert_match(/applying.*?rr.*?mock/, out)
assert_match_in_file(/gem 'rr'/, "#{@apptmp}/sample_project/Gemfile")
assert_match_in_file(/include RR::Adapters::RRMethods/m, "#{@apptmp}/sample_project/test/test_config.rb")
assert_match_in_file(/include RR::Adapters::TestUnit/m, "#{@apptmp}/sample_project/test/test_config.rb")
end

should "properly generate for rr and rspec" do
Expand Down

0 comments on commit 3c4f995

Please sign in to comment.