minitest-rails 0.5 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +16 -0
- data/Manifest.txt +5 -0
- data/README.rdoc +2 -1
- data/gemfiles/3.0.gemfile.lock +1 -1
- data/gemfiles/3.1.gemfile.lock +1 -1
- data/gemfiles/3.2.gemfile.lock +1 -1
- data/gemfiles/4.0.gemfile.lock +1 -1
- data/lib/generators/mini_test.rb +5 -2
- data/lib/generators/mini_test/controller/controller_generator.rb +0 -1
- data/lib/generators/mini_test/helper/helper_generator.rb +0 -2
- data/lib/generators/mini_test/integration/integration_generator.rb +0 -2
- data/lib/generators/mini_test/mailer/mailer_generator.rb +0 -1
- data/lib/generators/mini_test/model/model_generator.rb +0 -1
- data/lib/generators/mini_test/route/route_generator.rb +28 -0
- data/lib/generators/mini_test/route/templates/route_spec.rb +10 -0
- data/lib/generators/mini_test/route/templates/route_test.rb +10 -0
- data/lib/generators/mini_test/scaffold/scaffold_generator.rb +0 -1
- data/lib/minitest-rails.rb +1 -22
- data/lib/minitest/rails/railtie.rb +16 -0
- data/lib/minitest/rails/tasks/minitest.rake +17 -12
- data/lib/minitest/rails/version.rb +1 -1
- data/minitest-rails.gemspec +4 -4
- data/test/generators/test_route_generator.rb +24 -0
- data/test/rails/action_view/test_spec_type.rb +7 -0
- metadata +23 -17
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
=== 0.5.1 / 2013-01-24
|
2
|
+
|
3
|
+
* Add route test generator
|
4
|
+
* Several changes in rake tasks
|
5
|
+
|
6
|
+
https://github.com/blowmage/minitest-rails/compare/v0.5...v0.5.1
|
7
|
+
|
8
|
+
=== 0.5 / 2013-01-11
|
9
|
+
|
10
|
+
* Add support for Rails 4
|
11
|
+
* Use ActiveSupport::TestCase instead of MiniTest::Rails::ActiveSupport::TestCase.
|
12
|
+
* Add MiniTest::Rails::Testing
|
13
|
+
* Use MiniTest::Rails::Testing.default_tasks instead of MINITEST_TASKS.
|
14
|
+
|
15
|
+
https://github.com/blowmage/minitest-rails/compare/v0.3...v0.5
|
16
|
+
|
1
17
|
=== 0.3 / 2012-11-02
|
2
18
|
|
3
19
|
* Mailer lookup for spec-style tests
|
data/Manifest.txt
CHANGED
@@ -37,12 +37,16 @@ lib/generators/mini_test/model/model_generator.rb
|
|
37
37
|
lib/generators/mini_test/model/templates/fixtures.yml
|
38
38
|
lib/generators/mini_test/model/templates/model_spec.rb
|
39
39
|
lib/generators/mini_test/model/templates/model_test.rb
|
40
|
+
lib/generators/mini_test/route/route_generator.rb
|
41
|
+
lib/generators/mini_test/route/templates/route_spec.rb
|
42
|
+
lib/generators/mini_test/route/templates/route_test.rb
|
40
43
|
lib/generators/mini_test/scaffold/scaffold_generator.rb
|
41
44
|
lib/generators/mini_test/scaffold/templates/controller_spec.rb
|
42
45
|
lib/generators/mini_test/scaffold/templates/controller_test.rb
|
43
46
|
lib/minitest-rails.rb
|
44
47
|
lib/minitest/rails.rb
|
45
48
|
lib/minitest/rails/constant_lookup.rb
|
49
|
+
lib/minitest/rails/railtie.rb
|
46
50
|
lib/minitest/rails/tasks/minitest.rake
|
47
51
|
lib/minitest/rails/tasks/sub_test_task.rb
|
48
52
|
lib/minitest/rails/test_case.rb
|
@@ -56,6 +60,7 @@ test/generators/test_helper_generator.rb
|
|
56
60
|
test/generators/test_install_generator.rb
|
57
61
|
test/generators/test_mailer_generator.rb
|
58
62
|
test/generators/test_model_generator.rb
|
63
|
+
test/generators/test_route_generator.rb
|
59
64
|
test/generators/test_scaffold_generator.rb
|
60
65
|
test/helper.rb
|
61
66
|
test/rails/action_controller/test_controllers.rb
|
data/README.rdoc
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
MiniTest integration for Rails 3 and 4
|
4
4
|
|
5
|
-
{<img src="https://secure.travis-ci.org/blowmage/minitest-rails.png" alt="Build Status" />}[http://travis-ci.org/blowmage/minitest-rails]
|
5
|
+
{<img src="https://secure.travis-ci.org/blowmage/minitest-rails.png" alt="Build Status" />}[http://travis-ci.org/blowmage/minitest-rails]
|
6
|
+
<br>
|
6
7
|
{<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/blowmage/minitest-rails]
|
7
8
|
|
8
9
|
== Install
|
data/gemfiles/3.0.gemfile.lock
CHANGED
data/gemfiles/3.1.gemfile.lock
CHANGED
data/gemfiles/3.2.gemfile.lock
CHANGED
data/gemfiles/4.0.gemfile.lock
CHANGED
data/lib/generators/mini_test.rb
CHANGED
@@ -7,8 +7,11 @@ module MiniTest
|
|
7
7
|
class_option :old_style_hash, :type => :boolean, :default => false,
|
8
8
|
:desc => "Force using old style hash (:foo => 'bar') on Ruby >= 1.9"
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
class_option :spec, :type => :boolean, :default => false,
|
11
|
+
:desc => "Use MiniTest::Spec DSL"
|
12
|
+
|
13
|
+
def self.default_source_root
|
14
|
+
File.expand_path(File.join(File.dirname(__FILE__), 'mini_test', generator_name, 'templates'))
|
12
15
|
end
|
13
16
|
|
14
17
|
protected
|
@@ -4,7 +4,6 @@ module MiniTest
|
|
4
4
|
module Generators
|
5
5
|
class ControllerGenerator < Base
|
6
6
|
argument :actions, :type => :array, :default => [], :banner => "action action"
|
7
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
8
7
|
|
9
8
|
check_class_collision :suffix => "ControllerTest"
|
10
9
|
|
@@ -3,8 +3,6 @@ require "generators/mini_test"
|
|
3
3
|
module MiniTest
|
4
4
|
module Generators
|
5
5
|
class HelperGenerator < Base
|
6
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
7
|
-
|
8
6
|
check_class_collision :suffix => "HelperTest"
|
9
7
|
|
10
8
|
def create_test_files
|
@@ -3,8 +3,6 @@ require "generators/mini_test"
|
|
3
3
|
module MiniTest
|
4
4
|
module Generators
|
5
5
|
class IntegrationGenerator < Base
|
6
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
7
|
-
|
8
6
|
check_class_collision :suffix => "Test"
|
9
7
|
|
10
8
|
def create_test_files
|
@@ -4,7 +4,6 @@ module MiniTest
|
|
4
4
|
module Generators
|
5
5
|
class MailerGenerator < Base
|
6
6
|
argument :actions, :type => :array, :default => [], :banner => "method method"
|
7
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
8
7
|
|
9
8
|
check_class_collision :suffix => "MailerTest"
|
10
9
|
|
@@ -5,7 +5,6 @@ module MiniTest
|
|
5
5
|
class ModelGenerator < Base
|
6
6
|
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
|
7
7
|
class_option :fixture, :type => :boolean, :default => true, :desc => "Create fixture file"
|
8
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
9
8
|
|
10
9
|
check_class_collision :suffix => "Test"
|
11
10
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "generators/mini_test"
|
2
|
+
|
3
|
+
module MiniTest
|
4
|
+
module Generators
|
5
|
+
class RouteGenerator < ::Rails::Generators::Base
|
6
|
+
|
7
|
+
class_option :spec, :type => :boolean, :default => false,
|
8
|
+
:desc => "Use MiniTest::Spec DSL"
|
9
|
+
|
10
|
+
desc <<DESC
|
11
|
+
Description:
|
12
|
+
Creates a route test.
|
13
|
+
DESC
|
14
|
+
|
15
|
+
def self.source_root
|
16
|
+
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_test_files
|
20
|
+
if options[:spec]
|
21
|
+
template "route_spec.rb", File.join("test", "routes", "route_test.rb")
|
22
|
+
else
|
23
|
+
template "route_test.rb", File.join("test", "routes", "route_test.rb")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "minitest_helper"
|
2
|
+
|
3
|
+
# Add the following to your Rake file to test routes by default:
|
4
|
+
# MiniTest::Rails::Testing.default_tasks << "routes"
|
5
|
+
|
6
|
+
describe "Route Integration Test" do
|
7
|
+
it "route root" do
|
8
|
+
assert_routing "/", class: "home", action: "show"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "minitest_helper"
|
2
|
+
|
3
|
+
# Add the following to your Rake file to test routes by default:
|
4
|
+
# MiniTest::Rails::Testing.default_tasks << "routes"
|
5
|
+
|
6
|
+
class RouteTest < ActionDispatch::IntegrationTest
|
7
|
+
def test_root
|
8
|
+
assert_routing "/", class: "home", action: "show"
|
9
|
+
end
|
10
|
+
end
|
@@ -6,7 +6,6 @@ module MiniTest
|
|
6
6
|
class ScaffoldGenerator < Base
|
7
7
|
include ::Rails::Generators::ResourceHelpers
|
8
8
|
argument :actions, :type => :array, :default => [], :banner => "action action"
|
9
|
-
class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL"
|
10
9
|
|
11
10
|
check_class_collision :suffix => "ControllerTest"
|
12
11
|
|
data/lib/minitest-rails.rb
CHANGED
@@ -1,23 +1,2 @@
|
|
1
1
|
require "minitest/rails/version"
|
2
|
-
require "rails"
|
3
|
-
require "minitest/unit"
|
4
|
-
|
5
|
-
module MiniTest
|
6
|
-
module Rails
|
7
|
-
class Railtie < ::Rails::Railtie
|
8
|
-
if ::Rails.version.to_f >= 3.1
|
9
|
-
config.app_generators.integration_tool :mini_test
|
10
|
-
config.app_generators.test_framework :mini_test
|
11
|
-
config.app_generators.fallbacks[:mini_test] = :test_unit
|
12
|
-
else
|
13
|
-
config.generators.integration_tool :mini_test
|
14
|
-
config.generators.test_framework :mini_test
|
15
|
-
config.generators.fallbacks[:mini_test] = :test_unit
|
16
|
-
end
|
17
|
-
|
18
|
-
rake_tasks do
|
19
|
-
load "minitest/rails/tasks/minitest.rake"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
2
|
+
require "minitest/rails/railtie"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "rails"
|
2
|
+
|
3
|
+
module MiniTest
|
4
|
+
module Rails
|
5
|
+
class Railtie < ::Rails::Railtie
|
6
|
+
generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
|
7
|
+
generators.integration_tool :mini_test
|
8
|
+
generators.test_framework :mini_test
|
9
|
+
generators.fallbacks[:mini_test] = :test_unit
|
10
|
+
|
11
|
+
rake_tasks do
|
12
|
+
load "minitest/rails/tasks/minitest.rake"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,19 +2,13 @@ require "rake/testtask"
|
|
2
2
|
require "minitest/rails/testing"
|
3
3
|
require "minitest/rails/tasks/sub_test_task"
|
4
4
|
|
5
|
-
desc "Runs minitest"
|
6
|
-
task :test do
|
7
|
-
# Add to existing task if exists, or create new task otherwise
|
8
|
-
Rake::Task["minitest"].invoke
|
9
|
-
end
|
10
|
-
|
11
5
|
namespace "test" do
|
12
6
|
task :prepare do
|
13
7
|
# Define here in case test_unit isn't loaded
|
14
8
|
end
|
15
9
|
end
|
16
10
|
|
17
|
-
|
11
|
+
desc "Run default tests"
|
18
12
|
task :minitest do
|
19
13
|
Rake::Task["minitest:default"].invoke
|
20
14
|
end
|
@@ -26,15 +20,21 @@ namespace "minitest" do
|
|
26
20
|
MiniTest::Rails::Testing.run_tests MiniTest::Rails::Testing.default_tasks
|
27
21
|
end
|
28
22
|
|
29
|
-
|
30
|
-
# desc "Runs all tests"
|
23
|
+
desc "Run all tests"
|
31
24
|
task :all do
|
32
25
|
MiniTest::Rails::Testing.run_tests MiniTest::Rails::Testing.all_tasks
|
33
26
|
end
|
27
|
+
namespace "all" do
|
28
|
+
desc "Run all tests, ungrouped for quicker execution"
|
29
|
+
MiniTest::Rails::Tasks::SubTestTask.new(:quick => "test:prepare") do |t|
|
30
|
+
t.libs.push "test"
|
31
|
+
t.pattern = "test/**/*_test.rb"
|
32
|
+
end
|
33
|
+
end
|
34
34
|
|
35
35
|
MiniTest::Rails::Testing.all_tasks.each do |task_dir|
|
36
36
|
unless Rake::Task.task_defined? "minitest:#{task_dir}"
|
37
|
-
|
37
|
+
desc "Runs tests under test/#{task_dir}"
|
38
38
|
MiniTest::Rails::Tasks::SubTestTask.new(task_dir => "test:prepare") do |t|
|
39
39
|
t.libs.push "test"
|
40
40
|
t.pattern = "test/#{task_dir}/**/*_test.rb"
|
@@ -45,8 +45,13 @@ namespace "minitest" do
|
|
45
45
|
|
46
46
|
end
|
47
47
|
|
48
|
+
# Override the test task
|
49
|
+
task :test => [] # Just in case it hasn't already been set
|
50
|
+
Rake::Task[:test].clear
|
51
|
+
desc "Run default tests"
|
52
|
+
task :test => "minitest"
|
53
|
+
|
48
54
|
# Override the default task
|
49
|
-
task :default => [] # Just in case it hasn
|
55
|
+
task :default => [] # Just in case it hasn't already been set
|
50
56
|
Rake::Task[:default].clear
|
51
|
-
desc "Runs default tests"
|
52
57
|
task :default => "minitest"
|
data/minitest-rails.gemspec
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "minitest-rails"
|
5
|
-
s.version = "0.5.
|
5
|
+
s.version = "0.5.1.20130124111918"
|
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 = "2013-01-
|
9
|
+
s.date = "2013-01-24"
|
10
10
|
s.description = "Adds MiniTest as the default testing library in Rails 3 and 4"
|
11
11
|
s.email = ["mike@blowmage.com"]
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
|
13
|
-
s.files = [".autotest", ".gemtest", ".travis.yml", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "gemfiles/3.0.gemfile", "gemfiles/3.0.gemfile.lock", "gemfiles/3.1.gemfile", "gemfiles/3.1.gemfile.lock", "gemfiles/3.2.gemfile", "gemfiles/3.2.gemfile.lock", "gemfiles/4.0.gemfile", "gemfiles/4.0.gemfile.lock", "lib/autotest/discover.rb", "lib/autotest/fixtures.rb", "lib/autotest/migrate.rb", "lib/autotest/minitest_rails.rb", "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/constant_lookup.rb", "lib/minitest/rails/tasks/minitest.rake", "lib/minitest/rails/tasks/sub_test_task.rb", "lib/minitest/rails/test_case.rb", "lib/minitest/rails/testing.rb", "lib/minitest/rails/version.rb", "minitest-rails.gemspec", "tasks/gemfiles.rake", "tasks/test.rake", "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/helper.rb", "test/rails/action_controller/test_controllers.rb", "test/rails/action_controller/test_spec_type.rb", "test/rails/action_dispatch/test_spec_type.rb", "test/rails/action_mailer/test_mailers.rb", "test/rails/action_mailer/test_spec_type.rb", "test/rails/action_view/test_helpers.rb", "test/rails/action_view/test_spec_type.rb", "test/rails/active_support/test_spec_type.rb", "test/rails/test_constant_lookup.rb", "test/test_sanity.rb"]
|
13
|
+
s.files = [".autotest", ".gemtest", ".travis.yml", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "gemfiles/3.0.gemfile", "gemfiles/3.0.gemfile.lock", "gemfiles/3.1.gemfile", "gemfiles/3.1.gemfile.lock", "gemfiles/3.2.gemfile", "gemfiles/3.2.gemfile.lock", "gemfiles/4.0.gemfile", "gemfiles/4.0.gemfile.lock", "lib/autotest/discover.rb", "lib/autotest/fixtures.rb", "lib/autotest/migrate.rb", "lib/autotest/minitest_rails.rb", "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/route/route_generator.rb", "lib/generators/mini_test/route/templates/route_spec.rb", "lib/generators/mini_test/route/templates/route_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/constant_lookup.rb", "lib/minitest/rails/railtie.rb", "lib/minitest/rails/tasks/minitest.rake", "lib/minitest/rails/tasks/sub_test_task.rb", "lib/minitest/rails/test_case.rb", "lib/minitest/rails/testing.rb", "lib/minitest/rails/version.rb", "minitest-rails.gemspec", "tasks/gemfiles.rake", "tasks/test.rake", "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_route_generator.rb", "test/generators/test_scaffold_generator.rb", "test/helper.rb", "test/rails/action_controller/test_controllers.rb", "test/rails/action_controller/test_spec_type.rb", "test/rails/action_dispatch/test_spec_type.rb", "test/rails/action_mailer/test_mailers.rb", "test/rails/action_mailer/test_spec_type.rb", "test/rails/action_view/test_helpers.rb", "test/rails/action_view/test_spec_type.rb", "test/rails/active_support/test_spec_type.rb", "test/rails/test_constant_lookup.rb", "test/test_sanity.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.23"
|
19
19
|
s.summary = "MiniTest integration for Rails 3 and 4"
|
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/action_controller/test_controllers.rb", "test/rails/action_controller/test_spec_type.rb", "test/rails/action_dispatch/test_spec_type.rb", "test/rails/action_mailer/test_mailers.rb", "test/rails/action_mailer/test_spec_type.rb", "test/rails/action_view/test_helpers.rb", "test/rails/action_view/test_spec_type.rb", "test/rails/active_support/test_spec_type.rb", "test/rails/test_constant_lookup.rb", "test/test_sanity.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_route_generator.rb", "test/generators/test_scaffold_generator.rb", "test/rails/action_controller/test_controllers.rb", "test/rails/action_controller/test_spec_type.rb", "test/rails/action_dispatch/test_spec_type.rb", "test/rails/action_mailer/test_mailers.rb", "test/rails/action_mailer/test_spec_type.rb", "test/rails/action_view/test_helpers.rb", "test/rails/action_view/test_spec_type.rb", "test/rails/active_support/test_spec_type.rb", "test/rails/test_constant_lookup.rb", "test/test_sanity.rb"]
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
23
23
|
s.specification_version = 3
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "helper"
|
2
|
+
require "generators/mini_test/route/route_generator"
|
3
|
+
|
4
|
+
class TestRouteGenerator < GeneratorTest
|
5
|
+
|
6
|
+
def test_route_generator
|
7
|
+
assert_output(/create test\/routes\/route_test.rb/m) do
|
8
|
+
MiniTest::Generators::RouteGenerator.start
|
9
|
+
end
|
10
|
+
assert File.exists? "test/routes/route_test.rb"
|
11
|
+
contents = File.read "test/routes/route_test.rb"
|
12
|
+
assert_match(/class RouteTest/m, contents)
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_route_generator_spec
|
16
|
+
assert_output(/create test\/routes\/route_test.rb/m) do
|
17
|
+
MiniTest::Generators::RouteGenerator.start ["--spec"]
|
18
|
+
end
|
19
|
+
assert File.exists? "test/routes/route_test.rb"
|
20
|
+
contents = File.read "test/routes/route_test.rb"
|
21
|
+
assert_match(/describe "Route Integration Test" do/m, contents)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -25,6 +25,13 @@ class TestActionViewSpecType < MiniTest::Unit::TestCase
|
|
25
25
|
assert_view MiniTest::Spec.spec_type("widget view test")
|
26
26
|
end
|
27
27
|
|
28
|
+
def test_spec_type_wont_match_models_that_end_in_view
|
29
|
+
refute_view MiniTest::Spec.spec_type("NewsOverviewTest")
|
30
|
+
refute_view MiniTest::Spec.spec_type("News Overview Test")
|
31
|
+
refute_view MiniTest::Spec.spec_type("NewsOverview")
|
32
|
+
refute_view MiniTest::Spec.spec_type("News Overview")
|
33
|
+
end
|
34
|
+
|
28
35
|
def test_spec_type_wont_match_non_space_characters
|
29
36
|
refute_view MiniTest::Spec.spec_type("Widget Helper\tTest")
|
30
37
|
refute_view MiniTest::Spec.spec_type("Widget Helper\rTest")
|
metadata
CHANGED
@@ -2,25 +2,25 @@
|
|
2
2
|
name: minitest-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.5.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Moore
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
prerelease: false
|
16
|
-
type: :runtime
|
17
|
-
name: minitest
|
18
15
|
version_requirements: !ruby/object:Gem::Requirement
|
19
16
|
none: false
|
20
17
|
requirements:
|
21
18
|
- - ~>
|
22
19
|
- !ruby/object:Gem::Version
|
23
20
|
version: '4.0'
|
21
|
+
name: minitest
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
24
|
requirement: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
@@ -28,15 +28,15 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '4.0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
prerelease: false
|
32
|
-
type: :runtime
|
33
|
-
name: rails
|
34
31
|
version_requirements: !ruby/object:Gem::Requirement
|
35
32
|
none: false
|
36
33
|
requirements:
|
37
34
|
- - ! '>='
|
38
35
|
- !ruby/object:Gem::Version
|
39
36
|
version: '3.0'
|
37
|
+
name: rails
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
40
|
requirement: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
@@ -44,15 +44,15 @@ dependencies:
|
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '3.0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
prerelease: false
|
48
|
-
type: :development
|
49
|
-
name: rdoc
|
50
47
|
version_requirements: !ruby/object:Gem::Requirement
|
51
48
|
none: false
|
52
49
|
requirements:
|
53
50
|
- - ~>
|
54
51
|
- !ruby/object:Gem::Version
|
55
52
|
version: '3.10'
|
53
|
+
name: rdoc
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
@@ -60,15 +60,15 @@ dependencies:
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.10'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
prerelease: false
|
64
|
-
type: :development
|
65
|
-
name: fakefs
|
66
63
|
version_requirements: !ruby/object:Gem::Requirement
|
67
64
|
none: false
|
68
65
|
requirements:
|
69
66
|
- - ~>
|
70
67
|
- !ruby/object:Gem::Version
|
71
68
|
version: '0.4'
|
69
|
+
name: fakefs
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
@@ -76,15 +76,15 @@ dependencies:
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0.4'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
prerelease: false
|
80
|
-
type: :development
|
81
|
-
name: hoe
|
82
79
|
version_requirements: !ruby/object:Gem::Requirement
|
83
80
|
none: false
|
84
81
|
requirements:
|
85
82
|
- - ~>
|
86
83
|
- !ruby/object:Gem::Version
|
87
84
|
version: '3.4'
|
85
|
+
name: hoe
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
@@ -140,12 +140,16 @@ files:
|
|
140
140
|
- lib/generators/mini_test/model/templates/fixtures.yml
|
141
141
|
- lib/generators/mini_test/model/templates/model_spec.rb
|
142
142
|
- lib/generators/mini_test/model/templates/model_test.rb
|
143
|
+
- lib/generators/mini_test/route/route_generator.rb
|
144
|
+
- lib/generators/mini_test/route/templates/route_spec.rb
|
145
|
+
- lib/generators/mini_test/route/templates/route_test.rb
|
143
146
|
- lib/generators/mini_test/scaffold/scaffold_generator.rb
|
144
147
|
- lib/generators/mini_test/scaffold/templates/controller_spec.rb
|
145
148
|
- lib/generators/mini_test/scaffold/templates/controller_test.rb
|
146
149
|
- lib/minitest-rails.rb
|
147
150
|
- lib/minitest/rails.rb
|
148
151
|
- lib/minitest/rails/constant_lookup.rb
|
152
|
+
- lib/minitest/rails/railtie.rb
|
149
153
|
- lib/minitest/rails/tasks/minitest.rake
|
150
154
|
- lib/minitest/rails/tasks/sub_test_task.rb
|
151
155
|
- lib/minitest/rails/test_case.rb
|
@@ -159,6 +163,7 @@ files:
|
|
159
163
|
- test/generators/test_install_generator.rb
|
160
164
|
- test/generators/test_mailer_generator.rb
|
161
165
|
- test/generators/test_model_generator.rb
|
166
|
+
- test/generators/test_route_generator.rb
|
162
167
|
- test/generators/test_scaffold_generator.rb
|
163
168
|
- test/helper.rb
|
164
169
|
- test/rails/action_controller/test_controllers.rb
|
@@ -203,6 +208,7 @@ test_files:
|
|
203
208
|
- test/generators/test_install_generator.rb
|
204
209
|
- test/generators/test_mailer_generator.rb
|
205
210
|
- test/generators/test_model_generator.rb
|
211
|
+
- test/generators/test_route_generator.rb
|
206
212
|
- test/generators/test_scaffold_generator.rb
|
207
213
|
- test/rails/action_controller/test_controllers.rb
|
208
214
|
- test/rails/action_controller/test_spec_type.rb
|