minitest-spec-rails 3.0.7 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +46 -0
- data/Gemfile +3 -1
- data/Guardfile +7 -0
- data/README.md +195 -41
- data/Rakefile +4 -6
- data/lib/minitest-spec-rails.rb +8 -2
- data/lib/minitest-spec-rails/dsl.rb +52 -0
- data/lib/minitest-spec-rails/init/action_controller.rb +24 -0
- data/lib/minitest-spec-rails/init/action_dispatch.rb +17 -0
- data/lib/minitest-spec-rails/init/action_mailer.rb +26 -0
- data/lib/minitest-spec-rails/init/action_view.rb +38 -0
- data/lib/minitest-spec-rails/init/active_support.rb +28 -0
- data/lib/minitest-spec-rails/init/mini_shoulda.rb +47 -0
- data/lib/minitest-spec-rails/rails.rb +7 -0
- data/lib/minitest-spec-rails/version.rb +1 -1
- data/minitest-spec-rails.gemspec +21 -16
- data/test/cases/action_controller_test.rb +41 -0
- data/test/cases/action_dispatch_test.rb +48 -0
- data/test/cases/action_mailer_test.rb +42 -0
- data/test/cases/action_view_test.rb +44 -0
- data/test/cases/active_support_test.rb +43 -0
- data/test/cases/mini_shoulda_test.rb +38 -0
- data/test/dummy_app/app/controllers/application_controller.rb +7 -0
- data/test/dummy_app/app/controllers/users_controller.rb +8 -0
- data/test/dummy_app/app/helpers/application_helper.rb +2 -0
- data/test/dummy_app/app/helpers/foos_helper.rb +5 -0
- data/test/dummy_app/app/helpers/users_helper.rb +9 -0
- data/test/dummy_app/app/models/post.rb +6 -0
- data/test/dummy_app/app/models/user.rb +6 -0
- data/test/dummy_app/app/models/user_mailer.rb +10 -0
- data/test/dummy_app/app/views/user_mailer/welcome.erb +1 -0
- data/test/dummy_app/app/views/users/index.rhtml +2 -0
- data/test/dummy_app/config/boot.rb +126 -0
- data/test/dummy_app/config/database.yml +3 -0
- data/test/dummy_app/config/environment.rb +12 -0
- data/test/dummy_app/config/environments/test.rb +28 -0
- data/test/dummy_app/config/initializers/new_rails_defaults.rb +15 -0
- data/test/dummy_app/config/routes.rb +6 -0
- data/test/dummy_app/db/schema.rb +0 -0
- data/test/dummy_app/init.rb +13 -0
- data/test/dummy_app/log/.keep +0 -0
- data/test/dummy_app/public/.htaccess +40 -0
- data/test/dummy_app/public/404.html +30 -0
- data/test/dummy_app/public/422.html +30 -0
- data/test/dummy_app/public/500.html +30 -0
- data/test/dummy_app/script/console +3 -0
- data/test/dummy_app/script/generate +3 -0
- data/test/dummy_tests/application_controller_test.rb +93 -0
- data/test/dummy_tests/foo_helper_test.rb +12 -0
- data/test/dummy_tests/integration_test.rb +30 -0
- data/test/dummy_tests/user_mailer_test.rb +91 -0
- data/test/dummy_tests/user_test.rb +72 -0
- data/test/dummy_tests/users_controller_test.rb +23 -0
- data/test/dummy_tests/users_helper_test.rb +81 -0
- data/test/support/minitest.rb +7 -0
- data/test/support/shared_test_case_behavior.rb +30 -0
- data/test/test_helper.rb +12 -0
- data/test/test_helper_dummy.rb +8 -0
- metadata +238 -63
- data/lib/minitest-spec-rails/test_case.rb +0 -33
- data/lib/test/unit.rb +0 -9
- data/lib/test/unit/assertions.rb +0 -7
- data/lib/test/unit/testcase.rb +0 -23
@@ -1,33 +0,0 @@
|
|
1
|
-
if defined?(ActiveSupport::TestCase)
|
2
|
-
class << ActiveSupport::TestCase
|
3
|
-
remove_method :describe
|
4
|
-
end
|
5
|
-
|
6
|
-
MiniTest::Spec.register_spec_type ActiveSupport::TestCase do |desc|
|
7
|
-
desc.respond_to?(:ancestors) && !(desc.ancestors.map(&:to_s) & ["ActiveRecord::Base", "Mongoid::Document", "MongoMapper::Document", "DataMapper::Resource"]).empty?
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
if defined?(ActionController::TestCase)
|
12
|
-
class ActionController::TestCase
|
13
|
-
def self.determine_default_controller_class(name)
|
14
|
-
if name.match(/.*(?:^|::)(\w+Controller)/)
|
15
|
-
$1.constantize rescue nil
|
16
|
-
else
|
17
|
-
super(name)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
before { setup_controller_request_and_response }
|
22
|
-
end
|
23
|
-
|
24
|
-
MiniTest::Spec.register_spec_type /Controller/, ActionController::TestCase
|
25
|
-
end
|
26
|
-
|
27
|
-
if defined?(ActionController::IntegrationTest)
|
28
|
-
class ActionController::IntegrationTest
|
29
|
-
before { self.class.app = Rails.application }
|
30
|
-
end
|
31
|
-
|
32
|
-
MiniTest::Spec.register_spec_type /Integration Test$/, ActionController::IntegrationTest
|
33
|
-
end
|
data/lib/test/unit.rb
DELETED
data/lib/test/unit/assertions.rb
DELETED
data/lib/test/unit/testcase.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'minitest/spec'
|
2
|
-
require 'test/unit/assertions'
|
3
|
-
require 'pp'
|
4
|
-
|
5
|
-
module Test
|
6
|
-
module Unit
|
7
|
-
class TestCase < ::MiniTest::Spec
|
8
|
-
|
9
|
-
MINI_SPECUNIT = true
|
10
|
-
|
11
|
-
def mu_pp(obj)
|
12
|
-
obj.pretty_inspect.chomp
|
13
|
-
end
|
14
|
-
|
15
|
-
def build_message(head, template=nil, *arguments)
|
16
|
-
template &&= template.chomp
|
17
|
-
template.gsub(/\?/) { mu_pp(arguments.shift) }
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|