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.
Files changed (65) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +7 -0
  3. data/CHANGELOG.md +46 -0
  4. data/Gemfile +3 -1
  5. data/Guardfile +7 -0
  6. data/README.md +195 -41
  7. data/Rakefile +4 -6
  8. data/lib/minitest-spec-rails.rb +8 -2
  9. data/lib/minitest-spec-rails/dsl.rb +52 -0
  10. data/lib/minitest-spec-rails/init/action_controller.rb +24 -0
  11. data/lib/minitest-spec-rails/init/action_dispatch.rb +17 -0
  12. data/lib/minitest-spec-rails/init/action_mailer.rb +26 -0
  13. data/lib/minitest-spec-rails/init/action_view.rb +38 -0
  14. data/lib/minitest-spec-rails/init/active_support.rb +28 -0
  15. data/lib/minitest-spec-rails/init/mini_shoulda.rb +47 -0
  16. data/lib/minitest-spec-rails/rails.rb +7 -0
  17. data/lib/minitest-spec-rails/version.rb +1 -1
  18. data/minitest-spec-rails.gemspec +21 -16
  19. data/test/cases/action_controller_test.rb +41 -0
  20. data/test/cases/action_dispatch_test.rb +48 -0
  21. data/test/cases/action_mailer_test.rb +42 -0
  22. data/test/cases/action_view_test.rb +44 -0
  23. data/test/cases/active_support_test.rb +43 -0
  24. data/test/cases/mini_shoulda_test.rb +38 -0
  25. data/test/dummy_app/app/controllers/application_controller.rb +7 -0
  26. data/test/dummy_app/app/controllers/users_controller.rb +8 -0
  27. data/test/dummy_app/app/helpers/application_helper.rb +2 -0
  28. data/test/dummy_app/app/helpers/foos_helper.rb +5 -0
  29. data/test/dummy_app/app/helpers/users_helper.rb +9 -0
  30. data/test/dummy_app/app/models/post.rb +6 -0
  31. data/test/dummy_app/app/models/user.rb +6 -0
  32. data/test/dummy_app/app/models/user_mailer.rb +10 -0
  33. data/test/dummy_app/app/views/user_mailer/welcome.erb +1 -0
  34. data/test/dummy_app/app/views/users/index.rhtml +2 -0
  35. data/test/dummy_app/config/boot.rb +126 -0
  36. data/test/dummy_app/config/database.yml +3 -0
  37. data/test/dummy_app/config/environment.rb +12 -0
  38. data/test/dummy_app/config/environments/test.rb +28 -0
  39. data/test/dummy_app/config/initializers/new_rails_defaults.rb +15 -0
  40. data/test/dummy_app/config/routes.rb +6 -0
  41. data/test/dummy_app/db/schema.rb +0 -0
  42. data/test/dummy_app/init.rb +13 -0
  43. data/test/dummy_app/log/.keep +0 -0
  44. data/test/dummy_app/public/.htaccess +40 -0
  45. data/test/dummy_app/public/404.html +30 -0
  46. data/test/dummy_app/public/422.html +30 -0
  47. data/test/dummy_app/public/500.html +30 -0
  48. data/test/dummy_app/script/console +3 -0
  49. data/test/dummy_app/script/generate +3 -0
  50. data/test/dummy_tests/application_controller_test.rb +93 -0
  51. data/test/dummy_tests/foo_helper_test.rb +12 -0
  52. data/test/dummy_tests/integration_test.rb +30 -0
  53. data/test/dummy_tests/user_mailer_test.rb +91 -0
  54. data/test/dummy_tests/user_test.rb +72 -0
  55. data/test/dummy_tests/users_controller_test.rb +23 -0
  56. data/test/dummy_tests/users_helper_test.rb +81 -0
  57. data/test/support/minitest.rb +7 -0
  58. data/test/support/shared_test_case_behavior.rb +30 -0
  59. data/test/test_helper.rb +12 -0
  60. data/test/test_helper_dummy.rb +8 -0
  61. metadata +238 -63
  62. data/lib/minitest-spec-rails/test_case.rb +0 -33
  63. data/lib/test/unit.rb +0 -9
  64. data/lib/test/unit/assertions.rb +0 -7
  65. 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
@@ -1,9 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'test/unit/assertions'
3
- require 'test/unit/testcase'
4
-
5
- module Test
6
- module Unit
7
-
8
- end
9
- end
@@ -1,7 +0,0 @@
1
- require 'minitest/spec'
2
-
3
- module Test
4
- module Unit
5
- Assertions = ::MiniTest::Assertions
6
- end
7
- end
@@ -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