minitest-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,26 @@
1
+ ---
2
+ after_script:
3
+ - rake travis:after -t
4
+ before_script:
5
+ - gem install hoe-travis --no-rdoc --no-ri
6
+ - rake travis:before -t
7
+ language: ruby
8
+ notifications:
9
+ email:
10
+ - mike@blowmage.com
11
+ rvm:
12
+ - 1.9.3
13
+ - 1.9.2
14
+ - jruby-18mode
15
+ - jruby-19mode
16
+ - rbx-18mode
17
+ - rbx-19mode
18
+ - ruby-head
19
+ - jruby-head
20
+ - 1.8.7
21
+ - ree
22
+ gemfile:
23
+ - gemfiles/3.0.gemfile
24
+ - gemfiles/3.1.gemfile
25
+ - gemfiles/3.2.gemfile
26
+ script: rake travis
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,19 @@
1
- === 0.1.0 / 2012-07-09
1
+ === 0.1.2 / 2012-07-26
2
+
3
+ * Fix bug when ActionMailer isn't loaded (closes #66)
4
+ * Allow specs to use strings in `describe` blocks
5
+
6
+ https://github.com/blowmage/minitest-rails/compare/v0.1.1...v0.1.2
7
+
8
+ === 0.1.1 / 2012-07-17
9
+
10
+ * Improved rake tasks
11
+ * Improved Rails 3.0 support
12
+ * Fixed bug with nested describes
13
+
14
+ https://github.com/blowmage/minitest-rails/compare/v0.1...v0.1.1
15
+
16
+ === 0.1 / 2012-07-09
2
17
 
3
18
  This is a major change. The approach used is the same approach used in Rails 4. This version is very different than the 0.0.x versions.
4
19
 
data/Manifest.txt CHANGED
@@ -1,10 +1,14 @@
1
1
  .autotest
2
2
  .gemtest
3
+ .travis.yml
3
4
  CHANGELOG.rdoc
4
5
  LICENSE
5
6
  Manifest.txt
6
7
  README.rdoc
7
8
  Rakefile
9
+ gemfiles/3.0.gemfile
10
+ gemfiles/3.1.gemfile
11
+ gemfiles/3.2.gemfile
8
12
  lib/generators/mini_test.rb
9
13
  lib/generators/mini_test/controller/controller_generator.rb
10
14
  lib/generators/mini_test/controller/templates/controller_spec.rb
@@ -39,10 +43,14 @@ lib/minitest/rails/mochaing.rb
39
43
  lib/minitest/rails/tasks/minitest.rake
40
44
  lib/minitest/rails/tasks/sub_test_task.rb
41
45
  minitest-rails.gemspec
42
- test/test_controller_generator.rb
43
- test/test_helper_generator.rb
44
- test/test_install_generator.rb
45
- test/test_mailer_generator.rb
46
+ test/generators/test_controller_generator.rb
47
+ test/generators/test_helper_generator.rb
48
+ test/generators/test_install_generator.rb
49
+ test/generators/test_mailer_generator.rb
50
+ test/generators/test_model_generator.rb
51
+ test/generators/test_scaffold_generator.rb
52
+ test/rails/test_action_controller_spec_type.rb
53
+ test/rails/test_action_dispatch_spec_type.rb
54
+ test/rails/test_action_mailer_spec_type.rb
55
+ test/rails/test_action_view_spec_type.rb
46
56
  test/test_minitest.rb
47
- test/test_model_generator.rb
48
- test/test_scaffold_generator.rb
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ require 'hoe'
5
5
 
6
6
  Hoe.plugin :git
7
7
  Hoe.plugin :gemspec
8
+ Hoe.plugin :travis
8
9
  Hoe.plugins.delete :rubyforge
9
10
 
10
11
  Hoe.spec 'minitest-rails' do
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "~> 3.0.15"
4
+ gem "minitest", "~> 3.0"
5
+ gem "rdoc", "~> 3.10"
6
+ gem "hoe", "~> 3.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "~> 3.1.6"
4
+ gem "minitest", "~> 3.0"
5
+ gem "rdoc", "~> 3.10"
6
+ gem "hoe", "~> 3.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "~> 3.2.6"
4
+ gem "minitest", "~> 3.0"
5
+ gem "rdoc", "~> 3.10"
6
+ gem "hoe", "~> 3.0"
7
+
8
+ gemspec :path=>"../"
@@ -3,7 +3,7 @@ require "minitest/unit"
3
3
 
4
4
  module MiniTest
5
5
  module Rails
6
- VERSION = "0.1.1"
6
+ VERSION = "0.1.2"
7
7
  class Railtie < ::Rails::Railtie
8
8
  if ::Rails.version.to_f >= 3.1
9
9
  config.app_generators.integration_tool :mini_test
@@ -5,7 +5,7 @@ abort("Abort testing: Your Rails environment is running in production mode!") if
5
5
  require "minitest/rails/active_support"
6
6
  require "minitest/rails/action_controller"
7
7
  require "minitest/rails/action_view"
8
- require "minitest/rails/action_mailer"
8
+ require "minitest/rails/action_mailer" if defined? ActionMailer
9
9
  require "minitest/rails/action_dispatch"
10
10
 
11
11
  # Enable turn if it is available
@@ -21,7 +21,7 @@ module MiniTest
21
21
  ::ActiveSupport.const_set :TestCase, MiniTest::Rails::ActiveSupport::TestCase
22
22
  ::ActionController.const_set :TestCase, MiniTest::Rails::ActionController::TestCase
23
23
  ::ActionView.const_set :TestCase, MiniTest::Rails::ActionView::TestCase
24
- ::ActionMailer.const_set :TestCase, MiniTest::Rails::ActionMailer::TestCase
24
+ ::ActionMailer.const_set :TestCase, MiniTest::Rails::ActionMailer::TestCase if defined? ActionMailer
25
25
  ::ActionDispatch.const_set :IntegrationTest, MiniTest::Rails::ActionDispatch::IntegrationTest
26
26
  end
27
27
  end
@@ -9,8 +9,9 @@ module MiniTest
9
9
 
10
10
  # Use AC::TestCase for the base class when describing a controller
11
11
  register_spec_type(self) do |desc|
12
- desc < ::ActionController::Base
12
+ desc < ::ActionController::Base if desc.is_a?(Class)
13
13
  end
14
+ register_spec_type(/Controller( ?Test)?\z/i, self)
14
15
 
15
16
  include ::ActionController::TestCase::Behavior
16
17
  end
@@ -24,13 +24,11 @@ module MiniTest
24
24
  def app
25
25
  super || ::ActionDispatch::IntegrationTest.app
26
26
  end
27
+
28
+ # Register by name
29
+ register_spec_type(/Acceptance ?Test\z/i, self)
30
+ register_spec_type(/Integration ?Test\z/i, self)
27
31
  end
28
32
  end
29
33
  end
30
34
  end
31
-
32
- # Register by name
33
- MiniTest::Spec.register_spec_type(/AcceptanceTest$/, MiniTest::Rails::ActionDispatch::IntegrationTest)
34
- MiniTest::Spec.register_spec_type(/Acceptance Test$/, MiniTest::Rails::ActionDispatch::IntegrationTest)
35
- MiniTest::Spec.register_spec_type(/IntegrationTest$/, MiniTest::Rails::ActionDispatch::IntegrationTest)
36
- MiniTest::Spec.register_spec_type(/Integration Test$/, MiniTest::Rails::ActionDispatch::IntegrationTest)
@@ -7,9 +7,11 @@ module MiniTest
7
7
  class TestCase < MiniTest::Rails::ActiveSupport::TestCase
8
8
  # Use AM::TestCase for the base class when describing a mailer
9
9
  register_spec_type(self) do |desc|
10
- desc < ::ActionMailer::Base
10
+ desc < ::ActionMailer::Base if desc.is_a?(Class)
11
11
  end
12
12
 
13
+ register_spec_type(/Mailer( ?Test)?\z/i, self)
14
+
13
15
  include ::ActionMailer::TestCase::Behavior
14
16
  end
15
17
  end
@@ -6,13 +6,12 @@ module MiniTest
6
6
  module ActionView
7
7
  class TestCase < MiniTest::Rails::ActiveSupport::TestCase
8
8
  TestController = ::ActionView::TestCase::TestController
9
+
10
+ # Register by name, because Helpers are just modules
11
+ register_spec_type(/Helper( ?Test)?\z/i, self)
12
+
9
13
  include ::ActionView::TestCase::Behavior
10
14
  end
11
15
  end
12
16
  end
13
17
  end
14
-
15
- # Register by name, because Helpers are just modules
16
- MiniTest::Spec.register_spec_type(/Helper$/, MiniTest::Rails::ActionView::TestCase)
17
- MiniTest::Spec.register_spec_type(/HelperTest$/, MiniTest::Rails::ActionView::TestCase)
18
- MiniTest::Spec.register_spec_type(/Helper Test$/, MiniTest::Rails::ActionView::TestCase)
@@ -2,22 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "minitest-rails"
5
- s.version = "0.1.1.20120717012609"
5
+ s.version = "0.1.2.20120726190745"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mike Moore"]
9
- s.date = "2012-07-17"
9
+ s.date = "2012-07-27"
10
10
  s.description = "Adds MiniTest as the default testing library in Rails 3.x"
11
11
  s.email = ["mike@blowmage.com"]
12
12
  s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
13
- s.files = [".autotest", ".gemtest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/generators/mini_test.rb", "lib/generators/mini_test/controller/controller_generator.rb", "lib/generators/mini_test/controller/templates/controller_spec.rb", "lib/generators/mini_test/controller/templates/controller_test.rb", "lib/generators/mini_test/helper/helper_generator.rb", "lib/generators/mini_test/helper/templates/helper_spec.rb", "lib/generators/mini_test/helper/templates/helper_test.rb", "lib/generators/mini_test/install/install_generator.rb", "lib/generators/mini_test/install/templates/test/minitest_helper.rb", "lib/generators/mini_test/integration/integration_generator.rb", "lib/generators/mini_test/integration/templates/integration_spec.rb", "lib/generators/mini_test/integration/templates/integration_test.rb", "lib/generators/mini_test/mailer/mailer_generator.rb", "lib/generators/mini_test/mailer/templates/mailer_spec.rb", "lib/generators/mini_test/mailer/templates/mailer_test.rb", "lib/generators/mini_test/model/model_generator.rb", "lib/generators/mini_test/model/templates/fixtures.yml", "lib/generators/mini_test/model/templates/model_spec.rb", "lib/generators/mini_test/model/templates/model_test.rb", "lib/generators/mini_test/scaffold/scaffold_generator.rb", "lib/generators/mini_test/scaffold/templates/controller_spec.rb", "lib/generators/mini_test/scaffold/templates/controller_test.rb", "lib/minitest-rails.rb", "lib/minitest/rails.rb", "lib/minitest/rails/action_controller.rb", "lib/minitest/rails/action_dispatch.rb", "lib/minitest/rails/action_mailer.rb", "lib/minitest/rails/action_view.rb", "lib/minitest/rails/active_support.rb", "lib/minitest/rails/declarative.rb", "lib/minitest/rails/mochaing.rb", "lib/minitest/rails/tasks/minitest.rake", "lib/minitest/rails/tasks/sub_test_task.rb", "minitest-rails.gemspec", "test/test_controller_generator.rb", "test/test_helper_generator.rb", "test/test_install_generator.rb", "test/test_mailer_generator.rb", "test/test_minitest.rb", "test/test_model_generator.rb", "test/test_scaffold_generator.rb"]
13
+ s.files = [".autotest", ".gemtest", ".travis.yml", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "gemfiles/3.0.gemfile", "gemfiles/3.1.gemfile", "gemfiles/3.2.gemfile", "lib/generators/mini_test.rb", "lib/generators/mini_test/controller/controller_generator.rb", "lib/generators/mini_test/controller/templates/controller_spec.rb", "lib/generators/mini_test/controller/templates/controller_test.rb", "lib/generators/mini_test/helper/helper_generator.rb", "lib/generators/mini_test/helper/templates/helper_spec.rb", "lib/generators/mini_test/helper/templates/helper_test.rb", "lib/generators/mini_test/install/install_generator.rb", "lib/generators/mini_test/install/templates/test/minitest_helper.rb", "lib/generators/mini_test/integration/integration_generator.rb", "lib/generators/mini_test/integration/templates/integration_spec.rb", "lib/generators/mini_test/integration/templates/integration_test.rb", "lib/generators/mini_test/mailer/mailer_generator.rb", "lib/generators/mini_test/mailer/templates/mailer_spec.rb", "lib/generators/mini_test/mailer/templates/mailer_test.rb", "lib/generators/mini_test/model/model_generator.rb", "lib/generators/mini_test/model/templates/fixtures.yml", "lib/generators/mini_test/model/templates/model_spec.rb", "lib/generators/mini_test/model/templates/model_test.rb", "lib/generators/mini_test/scaffold/scaffold_generator.rb", "lib/generators/mini_test/scaffold/templates/controller_spec.rb", "lib/generators/mini_test/scaffold/templates/controller_test.rb", "lib/minitest-rails.rb", "lib/minitest/rails.rb", "lib/minitest/rails/action_controller.rb", "lib/minitest/rails/action_dispatch.rb", "lib/minitest/rails/action_mailer.rb", "lib/minitest/rails/action_view.rb", "lib/minitest/rails/active_support.rb", "lib/minitest/rails/declarative.rb", "lib/minitest/rails/mochaing.rb", "lib/minitest/rails/tasks/minitest.rake", "lib/minitest/rails/tasks/sub_test_task.rb", "minitest-rails.gemspec", "test/generators/test_controller_generator.rb", "test/generators/test_helper_generator.rb", "test/generators/test_install_generator.rb", "test/generators/test_mailer_generator.rb", "test/generators/test_model_generator.rb", "test/generators/test_scaffold_generator.rb", "test/rails/test_action_controller_spec_type.rb", "test/rails/test_action_dispatch_spec_type.rb", "test/rails/test_action_mailer_spec_type.rb", "test/rails/test_action_view_spec_type.rb", "test/test_minitest.rb"]
14
14
  s.homepage = "http://blowmage.com/minitest-rails"
15
15
  s.rdoc_options = ["--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = "minitest-rails"
18
18
  s.rubygems_version = "1.8.24"
19
19
  s.summary = "MiniTest integration for Rails 3.x"
20
- s.test_files = ["test/test_controller_generator.rb", "test/test_helper_generator.rb", "test/test_install_generator.rb", "test/test_mailer_generator.rb", "test/test_minitest.rb", "test/test_model_generator.rb", "test/test_scaffold_generator.rb"]
20
+ s.test_files = ["test/generators/test_controller_generator.rb", "test/generators/test_helper_generator.rb", "test/generators/test_install_generator.rb", "test/generators/test_mailer_generator.rb", "test/generators/test_model_generator.rb", "test/generators/test_scaffold_generator.rb", "test/rails/test_action_controller_spec_type.rb", "test/rails/test_action_dispatch_spec_type.rb", "test/rails/test_action_mailer_spec_type.rb", "test/rails/test_action_view_spec_type.rb", "test/test_minitest.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
23
23
  s.specification_version = 3
@@ -0,0 +1,33 @@
1
+ require "minitest/autorun"
2
+ require "rails"
3
+
4
+ require "minitest/rails/action_controller"
5
+ require "action_controller"
6
+
7
+ class ApplicationController < ActionController::Base; end
8
+ class ModelsController < ApplicationController; end
9
+
10
+ class TestApplicationControllerSpecType < MiniTest::Unit::TestCase
11
+ def test_spec_type_resolves_for_class_constants
12
+ assert_equal MiniTest::Spec.spec_type(ApplicationController), MiniTest::Rails::ActionController::TestCase
13
+ assert_equal MiniTest::Spec.spec_type(ModelsController), MiniTest::Rails::ActionController::TestCase
14
+ end
15
+
16
+ def test_spec_type_resolves_for_matching_strings
17
+ assert_equal MiniTest::Spec.spec_type("WidgetController"), MiniTest::Rails::ActionController::TestCase
18
+ assert_equal MiniTest::Spec.spec_type("WidgetControllerTest"), MiniTest::Rails::ActionController::TestCase
19
+ assert_equal MiniTest::Spec.spec_type("Widget Controller Test"), MiniTest::Rails::ActionController::TestCase
20
+ # And is not case sensitive
21
+ assert_equal MiniTest::Spec.spec_type("widgetcontroller"), MiniTest::Rails::ActionController::TestCase
22
+ assert_equal MiniTest::Spec.spec_type("widgetcontrollertest"), MiniTest::Rails::ActionController::TestCase
23
+ assert_equal MiniTest::Spec.spec_type("widget controller test"), MiniTest::Rails::ActionController::TestCase
24
+ end
25
+
26
+ def test_spec_type_wont_match_non_space_characters
27
+ refute_equal MiniTest::Spec.spec_type("Widget Controller\tTest"), MiniTest::Rails::ActionController::TestCase
28
+ refute_equal MiniTest::Spec.spec_type("Widget Controller\rTest"), MiniTest::Rails::ActionController::TestCase
29
+ refute_equal MiniTest::Spec.spec_type("Widget Controller\nTest"), MiniTest::Rails::ActionController::TestCase
30
+ refute_equal MiniTest::Spec.spec_type("Widget Controller\fTest"), MiniTest::Rails::ActionController::TestCase
31
+ refute_equal MiniTest::Spec.spec_type("Widget ControllerXTest"), MiniTest::Rails::ActionController::TestCase
32
+ end
33
+ end
@@ -0,0 +1,40 @@
1
+ require "minitest/autorun"
2
+ require "rails"
3
+
4
+ require "minitest/rails/action_dispatch"
5
+
6
+ class TestActionDispatchSpecType < MiniTest::Unit::TestCase
7
+ def test_spec_type_resolves_for_matching_acceptance_strings
8
+ assert_equal MiniTest::Spec.spec_type("WidgetAcceptanceTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
9
+ assert_equal MiniTest::Spec.spec_type("Widget Acceptance Test"), MiniTest::Rails::ActionDispatch::IntegrationTest
10
+ # And is not case sensitive
11
+ assert_equal MiniTest::Spec.spec_type("widgetacceptancetest"), MiniTest::Rails::ActionDispatch::IntegrationTest
12
+ assert_equal MiniTest::Spec.spec_type("widget acceptance test"), MiniTest::Rails::ActionDispatch::IntegrationTest
13
+ end
14
+
15
+ def test_spec_type_wont_match_non_space_characters_acceptance
16
+ refute_equal MiniTest::Spec.spec_type("Widget Acceptance\tTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
17
+ refute_equal MiniTest::Spec.spec_type("Widget Acceptance\rTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
18
+ # TODO: Update regex so that new lines don't match.
19
+ refute_equal MiniTest::Spec.spec_type("Widget Acceptance\nTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
20
+ refute_equal MiniTest::Spec.spec_type("Widget Acceptance\fTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
21
+ refute_equal MiniTest::Spec.spec_type("Widget AcceptanceXTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
22
+ end
23
+
24
+ def test_spec_type_resolves_for_matching_integration_strings
25
+ assert_equal MiniTest::Spec.spec_type("WidgetIntegrationTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
26
+ assert_equal MiniTest::Spec.spec_type("Widget Integration Test"), MiniTest::Rails::ActionDispatch::IntegrationTest
27
+ # And is not case sensitive
28
+ assert_equal MiniTest::Spec.spec_type("widgetintegrationtest"), MiniTest::Rails::ActionDispatch::IntegrationTest
29
+ assert_equal MiniTest::Spec.spec_type("widget integration test"), MiniTest::Rails::ActionDispatch::IntegrationTest
30
+ end
31
+
32
+ def test_spec_type_wont_match_non_space_characters_integration
33
+ refute_equal MiniTest::Spec.spec_type("Widget Integration\tTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
34
+ refute_equal MiniTest::Spec.spec_type("Widget Integration\rTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
35
+ # TODO: Update regex so that new lines don't match.
36
+ refute_equal MiniTest::Spec.spec_type("Widget Integration\nTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
37
+ refute_equal MiniTest::Spec.spec_type("Widget Integration\fTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
38
+ refute_equal MiniTest::Spec.spec_type("Widget IntegrationXTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
39
+ end
40
+ end
@@ -0,0 +1,34 @@
1
+ require "minitest/autorun"
2
+ require "rails"
3
+
4
+ require "action_mailer/test_helper"
5
+ require "minitest/rails/action_mailer"
6
+ require "action_mailer"
7
+
8
+ class NotificationMailer < ActionMailer::Base; end
9
+ class Notifications < ActionMailer::Base; end
10
+
11
+ class TestActionMailerSpecType < MiniTest::Unit::TestCase
12
+ def test_spec_type_resolves_for_class_constants
13
+ assert_equal MiniTest::Spec.spec_type(NotificationMailer), MiniTest::Rails::ActionMailer::TestCase
14
+ assert_equal MiniTest::Spec.spec_type(Notifications), MiniTest::Rails::ActionMailer::TestCase
15
+ end
16
+
17
+ def test_spec_type_resolves_for_matching_strings
18
+ assert_equal MiniTest::Spec.spec_type("WidgetMailer"), MiniTest::Rails::ActionMailer::TestCase
19
+ assert_equal MiniTest::Spec.spec_type("WidgetMailerTest"), MiniTest::Rails::ActionMailer::TestCase
20
+ assert_equal MiniTest::Spec.spec_type("Widget Mailer Test"), MiniTest::Rails::ActionMailer::TestCase
21
+ # And is not case sensitive
22
+ assert_equal MiniTest::Spec.spec_type("widgetmailer"), MiniTest::Rails::ActionMailer::TestCase
23
+ assert_equal MiniTest::Spec.spec_type("widgetmailertest"), MiniTest::Rails::ActionMailer::TestCase
24
+ assert_equal MiniTest::Spec.spec_type("widget mailer test"), MiniTest::Rails::ActionMailer::TestCase
25
+ end
26
+
27
+ def test_spec_type_wont_match_non_space_characters
28
+ refute_equal MiniTest::Spec.spec_type("Widget Mailer\tTest"), MiniTest::Rails::ActionMailer::TestCase
29
+ refute_equal MiniTest::Spec.spec_type("Widget Mailer\rTest"), MiniTest::Rails::ActionMailer::TestCase
30
+ refute_equal MiniTest::Spec.spec_type("Widget Mailer\nTest"), MiniTest::Rails::ActionMailer::TestCase
31
+ refute_equal MiniTest::Spec.spec_type("Widget Mailer\fTest"), MiniTest::Rails::ActionMailer::TestCase
32
+ refute_equal MiniTest::Spec.spec_type("Widget MailerXTest"), MiniTest::Rails::ActionMailer::TestCase
33
+ end
34
+ end
@@ -0,0 +1,24 @@
1
+ require "minitest/autorun"
2
+ require "rails"
3
+
4
+ require "minitest/rails/action_view"
5
+
6
+ class TestActionViewSpecType < MiniTest::Unit::TestCase
7
+ def test_spec_type_resolves_for_matching_strings
8
+ assert_equal MiniTest::Spec.spec_type("WidgetHelper"), MiniTest::Rails::ActionView::TestCase
9
+ assert_equal MiniTest::Spec.spec_type("WidgetHelperTest"), MiniTest::Rails::ActionView::TestCase
10
+ assert_equal MiniTest::Spec.spec_type("Widget Helper Test"), MiniTest::Rails::ActionView::TestCase
11
+ # And is not case sensitive
12
+ assert_equal MiniTest::Spec.spec_type("widgethelper"), MiniTest::Rails::ActionView::TestCase
13
+ assert_equal MiniTest::Spec.spec_type("widgethelpertest"), MiniTest::Rails::ActionView::TestCase
14
+ assert_equal MiniTest::Spec.spec_type("widget helper test"), MiniTest::Rails::ActionView::TestCase
15
+ end
16
+
17
+ def test_spec_type_wont_match_non_space_characters
18
+ refute_equal MiniTest::Spec.spec_type("Widget Helper\tTest"), MiniTest::Rails::ActionView::TestCase
19
+ refute_equal MiniTest::Spec.spec_type("Widget Helper\rTest"), MiniTest::Rails::ActionView::TestCase
20
+ refute_equal MiniTest::Spec.spec_type("Widget Helper\nTest"), MiniTest::Rails::ActionView::TestCase
21
+ refute_equal MiniTest::Spec.spec_type("Widget Helper\fTest"), MiniTest::Rails::ActionView::TestCase
22
+ refute_equal MiniTest::Spec.spec_type("Widget HelperXTest"), MiniTest::Rails::ActionView::TestCase
23
+ end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-17 00:00:00.000000000 Z
12
+ date: 2012-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -87,11 +87,15 @@ extra_rdoc_files:
87
87
  files:
88
88
  - .autotest
89
89
  - .gemtest
90
+ - .travis.yml
90
91
  - CHANGELOG.rdoc
91
92
  - LICENSE
92
93
  - Manifest.txt
93
94
  - README.rdoc
94
95
  - Rakefile
96
+ - gemfiles/3.0.gemfile
97
+ - gemfiles/3.1.gemfile
98
+ - gemfiles/3.2.gemfile
95
99
  - lib/generators/mini_test.rb
96
100
  - lib/generators/mini_test/controller/controller_generator.rb
97
101
  - lib/generators/mini_test/controller/templates/controller_spec.rb
@@ -126,13 +130,17 @@ files:
126
130
  - lib/minitest/rails/tasks/minitest.rake
127
131
  - lib/minitest/rails/tasks/sub_test_task.rb
128
132
  - minitest-rails.gemspec
129
- - test/test_controller_generator.rb
130
- - test/test_helper_generator.rb
131
- - test/test_install_generator.rb
132
- - test/test_mailer_generator.rb
133
+ - test/generators/test_controller_generator.rb
134
+ - test/generators/test_helper_generator.rb
135
+ - test/generators/test_install_generator.rb
136
+ - test/generators/test_mailer_generator.rb
137
+ - test/generators/test_model_generator.rb
138
+ - test/generators/test_scaffold_generator.rb
139
+ - test/rails/test_action_controller_spec_type.rb
140
+ - test/rails/test_action_dispatch_spec_type.rb
141
+ - test/rails/test_action_mailer_spec_type.rb
142
+ - test/rails/test_action_view_spec_type.rb
133
143
  - test/test_minitest.rb
134
- - test/test_model_generator.rb
135
- - test/test_scaffold_generator.rb
136
144
  homepage: http://blowmage.com/minitest-rails
137
145
  licenses: []
138
146
  post_install_message:
@@ -160,10 +168,14 @@ signing_key:
160
168
  specification_version: 3
161
169
  summary: MiniTest integration for Rails 3.x
162
170
  test_files:
163
- - test/test_controller_generator.rb
164
- - test/test_helper_generator.rb
165
- - test/test_install_generator.rb
166
- - test/test_mailer_generator.rb
171
+ - test/generators/test_controller_generator.rb
172
+ - test/generators/test_helper_generator.rb
173
+ - test/generators/test_install_generator.rb
174
+ - test/generators/test_mailer_generator.rb
175
+ - test/generators/test_model_generator.rb
176
+ - test/generators/test_scaffold_generator.rb
177
+ - test/rails/test_action_controller_spec_type.rb
178
+ - test/rails/test_action_dispatch_spec_type.rb
179
+ - test/rails/test_action_mailer_spec_type.rb
180
+ - test/rails/test_action_view_spec_type.rb
167
181
  - test/test_minitest.rb
168
- - test/test_model_generator.rb
169
- - test/test_scaffold_generator.rb