minitest-rails 1.0.0.beta3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Rakefile +11 -11
- data/gemfiles/3.1.gemfile +1 -1
- data/gemfiles/3.2.gemfile +1 -1
- data/gemfiles/4.0.gemfile +1 -1
- data/lib/generators/mini_test.rb +3 -3
- data/lib/minitest/rails/tasks/minitest.rake +23 -5
- data/lib/minitest/rails/version.rb +1 -1
- data/minitest-rails.gemspec +15 -16
- data/tasks/test.rake +8 -5
- data/test/generators/test_controller_generator.rb +16 -0
- data/test/generators/test_model_generator.rb +16 -0
- metadata +33 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9da640f8490dbe94c8afbf0bcb4ff09c13190938
|
4
|
+
data.tar.gz: 87912e02f1001fec0e9ae084b9e919e38c6b8f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ea956c2165f225b52d08a6a953af80393e0d103f55983943942c5aadc0db3a21b019180bc099813466779a59954ebe7d3c2b272d7b96f5107e0b5621d154e37
|
7
|
+
data.tar.gz: ce377ad557be865cd24ec9ea0d41f66b64d417928990593f5024a0271b1a2cfee27d9617a2e43df53eb570004b1d1973d4268f9c164585dabeabf4204ad37522
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
5
|
|
6
6
|
Hoe.plugin :git
|
7
7
|
Hoe.plugin :gemspec
|
8
8
|
|
9
|
-
Hoe.spec
|
10
|
-
developer
|
9
|
+
Hoe.spec "minitest-rails" do
|
10
|
+
developer "Mike Moore", "mike@blowmage.com"
|
11
11
|
|
12
|
-
self.summary =
|
13
|
-
self.description =
|
14
|
-
self.urls = [
|
12
|
+
self.summary = "MiniTest integration for Rails 3 and 4"
|
13
|
+
self.description = "Adds MiniTest as the default testing library in Rails 3 and 4"
|
14
|
+
self.urls = ["http://blowmage.com/minitest-rails"]
|
15
15
|
|
16
16
|
self.history_file = "CHANGELOG.rdoc"
|
17
17
|
self.readme_file = "README.rdoc"
|
@@ -19,10 +19,10 @@ Hoe.spec 'minitest-rails' do
|
|
19
19
|
|
20
20
|
license "MIT"
|
21
21
|
|
22
|
-
dependency
|
23
|
-
dependency
|
24
|
-
dependency
|
25
|
-
dependency
|
22
|
+
dependency "minitest", "~> 4.7"
|
23
|
+
dependency "minitest-test", "~> 1.0"
|
24
|
+
dependency "railties", [ ">= 3.0", "< 4.1" ]
|
25
|
+
dependency "fakefs", "= 0.4.3", :dev
|
26
26
|
end
|
27
27
|
|
28
28
|
Dir["tasks/**/*.rake"].each { |t| load t }
|
data/gemfiles/3.1.gemfile
CHANGED
data/gemfiles/3.2.gemfile
CHANGED
data/gemfiles/4.0.gemfile
CHANGED
data/lib/generators/mini_test.rb
CHANGED
@@ -20,7 +20,7 @@ module MiniTest
|
|
20
20
|
|
21
21
|
def module_namespacing(&block)
|
22
22
|
yield if block_given?
|
23
|
-
end unless
|
23
|
+
end unless instance_methods(true).map(&:to_sym).include? :module_namespacing
|
24
24
|
|
25
25
|
def key_value(key, value)
|
26
26
|
if options[:old_style_hash] || RUBY_VERSION < '1.9'
|
@@ -28,14 +28,14 @@ module MiniTest
|
|
28
28
|
else
|
29
29
|
"#{key}: #{value}"
|
30
30
|
end
|
31
|
-
end unless
|
31
|
+
end unless instance_methods(true).map(&:to_sym).include? :key_value
|
32
32
|
|
33
33
|
def attributes_names
|
34
34
|
@attributes_names ||= attributes.each_with_object([]) do |a, names|
|
35
35
|
names << a.column_name
|
36
36
|
names << "#{a.name}_type" if a.polymorphic?
|
37
37
|
end
|
38
|
-
end unless
|
38
|
+
end unless instance_methods(true).map(&:to_sym).include? :attributes_names
|
39
39
|
|
40
40
|
end
|
41
41
|
end
|
@@ -91,11 +91,29 @@ namespace "minitest" do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
#
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
94
|
+
# Define tasks under "test" if they don't already exist
|
95
|
+
if !Rake::Task.task_defined? :test
|
96
|
+
desc "Runs default tests"
|
97
|
+
task :test => "minitest"
|
98
|
+
|
99
|
+
namespace "test" do
|
100
|
+
MiniTest::Rails::Testing.all_tasks.each do |task_dir|
|
101
|
+
desc "Runs tests under test/#{task_dir}"
|
102
|
+
task task_dir => "minitest:#{task_dir}"
|
103
|
+
end
|
104
|
+
|
105
|
+
desc "Runs the default tests, without resetting the db"
|
106
|
+
task "quick" => "minitest:quick"
|
107
|
+
|
108
|
+
desc "Runs all tests"
|
109
|
+
task "all" => "minitest:all"
|
110
|
+
|
111
|
+
namespace "all" do
|
112
|
+
desc "Runs all tests, without resetting the db"
|
113
|
+
task "quick" => "minitest:all:quick"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
99
117
|
|
100
118
|
# Override the default task
|
101
119
|
task :default => [] # Just in case it hasn't already been set
|
data/minitest-rails.gemspec
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: minitest-rails 1.0.0.
|
2
|
+
# stub: minitest-rails 1.0.0.20140414095814 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "minitest-rails"
|
6
|
-
s.version = "1.0.0.
|
6
|
+
s.version = "1.0.0.20140414095814"
|
7
7
|
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
|
+
s.require_paths = ["lib"]
|
9
10
|
s.authors = ["Mike Moore"]
|
10
|
-
s.date = "2014-
|
11
|
+
s.date = "2014-04-14"
|
11
12
|
s.description = "Adds MiniTest as the default testing library in Rails 3 and 4"
|
12
13
|
s.email = ["mike@blowmage.com"]
|
13
14
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
|
@@ -15,9 +16,7 @@ Gem::Specification.new do |s|
|
|
15
16
|
s.homepage = "http://blowmage.com/minitest-rails"
|
16
17
|
s.licenses = ["MIT"]
|
17
18
|
s.rdoc_options = ["--main", "README.rdoc"]
|
18
|
-
s.
|
19
|
-
s.rubyforge_project = "minitest-rails"
|
20
|
-
s.rubygems_version = "2.1.11"
|
19
|
+
s.rubygems_version = "2.2.2"
|
21
20
|
s.summary = "MiniTest integration for Rails 3 and 4"
|
22
21
|
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_assertions.rb", "test/rails/action_controller/test_controllers.rb", "test/rails/action_controller/test_expectations.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_assertions.rb", "test/rails/active_support/test_expectations.rb", "test/rails/active_support/test_spec_type.rb", "test/rails/generators/test_spec_type.rb", "test/rails/test_constant_lookup.rb", "test/test_sanity.rb", "test/rails/minitest_5_api_test.rb"]
|
23
22
|
|
@@ -27,24 +26,24 @@ Gem::Specification.new do |s|
|
|
27
26
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
27
|
s.add_runtime_dependency(%q<minitest>, ["~> 4.7"])
|
29
28
|
s.add_runtime_dependency(%q<minitest-test>, ["~> 1.0"])
|
30
|
-
s.add_runtime_dependency(%q<railties>, [">= 3.0"])
|
29
|
+
s.add_runtime_dependency(%q<railties>, ["< 4.1", ">= 3.0"])
|
31
30
|
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
32
|
-
s.add_development_dependency(%q<fakefs>, ["
|
33
|
-
s.add_development_dependency(%q<hoe>, ["~> 3.
|
31
|
+
s.add_development_dependency(%q<fakefs>, ["= 0.4.3"])
|
32
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.11"])
|
34
33
|
else
|
35
34
|
s.add_dependency(%q<minitest>, ["~> 4.7"])
|
36
35
|
s.add_dependency(%q<minitest-test>, ["~> 1.0"])
|
37
|
-
s.add_dependency(%q<railties>, [">= 3.0"])
|
36
|
+
s.add_dependency(%q<railties>, ["< 4.1", ">= 3.0"])
|
38
37
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
39
|
-
s.add_dependency(%q<fakefs>, ["
|
40
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
38
|
+
s.add_dependency(%q<fakefs>, ["= 0.4.3"])
|
39
|
+
s.add_dependency(%q<hoe>, ["~> 3.11"])
|
41
40
|
end
|
42
41
|
else
|
43
42
|
s.add_dependency(%q<minitest>, ["~> 4.7"])
|
44
43
|
s.add_dependency(%q<minitest-test>, ["~> 1.0"])
|
45
|
-
s.add_dependency(%q<railties>, [">= 3.0"])
|
44
|
+
s.add_dependency(%q<railties>, ["< 4.1", ">= 3.0"])
|
46
45
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
47
|
-
s.add_dependency(%q<fakefs>, ["
|
48
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
46
|
+
s.add_dependency(%q<fakefs>, ["= 0.4.3"])
|
47
|
+
s.add_dependency(%q<hoe>, ["~> 3.11"])
|
49
48
|
end
|
50
49
|
end
|
data/tasks/test.rake
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
namespace :test do
|
2
2
|
desc "Run tests for Rails 4.0"
|
3
3
|
task "4.0" do
|
4
|
+
sh "rm -f Gemfile.lock"
|
4
5
|
ENV["RAILS_VERSION"] = "4.0"
|
5
6
|
sh "bundle && bundle exec rake test"
|
6
|
-
sh "rm Gemfile.lock"
|
7
|
+
sh "rm -f Gemfile.lock"
|
7
8
|
end
|
8
9
|
|
9
10
|
desc "Run tests for Rails 3.2"
|
10
11
|
task "3.2" do
|
12
|
+
sh "rm -f Gemfile.lock"
|
11
13
|
ENV["RAILS_VERSION"] = "3.2"
|
12
14
|
sh "bundle && bundle exec rake test"
|
13
|
-
sh "rm Gemfile.lock"
|
15
|
+
sh "rm -f Gemfile.lock"
|
14
16
|
end
|
15
17
|
|
16
18
|
desc "Run tests for Rails 3.1"
|
17
19
|
task "3.1" do
|
20
|
+
sh "rm -f Gemfile.lock"
|
18
21
|
ENV["RAILS_VERSION"] = "3.1"
|
19
22
|
sh "bundle && bundle exec rake test"
|
20
|
-
sh "rm Gemfile.lock"
|
23
|
+
sh "rm -f Gemfile.lock"
|
21
24
|
end
|
22
25
|
|
23
26
|
desc "Run tests for Rails 3.0"
|
24
27
|
task "3.0" do
|
28
|
+
sh "rm -f Gemfile.lock"
|
25
29
|
ENV["RAILS_VERSION"] = "3.0"
|
26
30
|
sh "bundle && bundle exec rake test"
|
27
|
-
sh "rm Gemfile.lock"
|
31
|
+
sh "rm -f Gemfile.lock"
|
28
32
|
end
|
29
33
|
|
30
34
|
desc "Run tests for all Rails versions"
|
@@ -35,4 +39,3 @@ namespace :test do
|
|
35
39
|
sh "rake test:3.0"
|
36
40
|
end
|
37
41
|
end
|
38
|
-
|
@@ -21,6 +21,22 @@ class TestControllerGenerator < GeneratorTest
|
|
21
21
|
assert_match(/class Admin::UserControllerTest/m, contents)
|
22
22
|
end
|
23
23
|
|
24
|
+
def test_module_namespaced_controller_generator
|
25
|
+
assert_nil Rails::Generators.namespace
|
26
|
+
Rails::Generators.namespace = TestApp
|
27
|
+
|
28
|
+
assert_output(/create test\/controllers\/test_app\/user_controller_test.rb/m) do
|
29
|
+
MiniTest::Generators::ControllerGenerator.start ["user"]
|
30
|
+
end
|
31
|
+
assert File.exists? "test/controllers/test_app/user_controller_test.rb"
|
32
|
+
contents = File.read "test/controllers/test_app/user_controller_test.rb"
|
33
|
+
assert_match(/module TestApp/m, contents)
|
34
|
+
assert_match(/class UserControllerTest/m, contents)
|
35
|
+
ensure
|
36
|
+
# Restore default namespace
|
37
|
+
Rails::Generators.namespace = nil
|
38
|
+
end if Rails::Generators.respond_to? :namespace
|
39
|
+
|
24
40
|
def test_controller_generator_spec
|
25
41
|
assert_output(/create test\/controllers\/user_controller_test.rb/m) do
|
26
42
|
MiniTest::Generators::ControllerGenerator.start ["user", "--spec"]
|
@@ -21,6 +21,22 @@ class TestModelGenerator < GeneratorTest
|
|
21
21
|
assert_match(/class Admin::UserTest/m, contents)
|
22
22
|
end
|
23
23
|
|
24
|
+
def test_module_namespaced_model_generator
|
25
|
+
assert_nil Rails::Generators.namespace
|
26
|
+
Rails::Generators.namespace = TestApp
|
27
|
+
|
28
|
+
assert_output(/create test\/models\/test_app\/user_test.rb/m) do
|
29
|
+
MiniTest::Generators::ModelGenerator.start ["user"]
|
30
|
+
end
|
31
|
+
assert File.exists? "test/models/test_app/user_test.rb"
|
32
|
+
contents = File.read "test/models/test_app/user_test.rb"
|
33
|
+
assert_match(/module TestApp/m, contents)
|
34
|
+
assert_match(/class UserTest/m, contents)
|
35
|
+
ensure
|
36
|
+
# Restore default namespace
|
37
|
+
Rails::Generators.namespace = nil
|
38
|
+
end if Rails::Generators.respond_to? :namespace
|
39
|
+
|
24
40
|
def test_model_generator_spec
|
25
41
|
assert_output(/create test\/models\/user_test.rb/m) do
|
26
42
|
MiniTest::Generators::ModelGenerator.start ["user", "--spec"]
|
metadata
CHANGED
@@ -1,99 +1,105 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest-test
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: railties
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '4.1'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- -
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '3.0'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.1'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rdoc
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - ~>
|
65
|
+
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
67
|
version: '4.0'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
|
-
- - ~>
|
72
|
+
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '4.0'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: fakefs
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- -
|
79
|
+
- - '='
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
81
|
+
version: 0.4.3
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
|
-
- -
|
86
|
+
- - '='
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
88
|
+
version: 0.4.3
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: hoe
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
|
-
- - ~>
|
93
|
+
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
95
|
+
version: '3.11'
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
|
-
- - ~>
|
100
|
+
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
102
|
+
version: '3.11'
|
97
103
|
description: Adds MiniTest as the default testing library in Rails 3 and 4
|
98
104
|
email:
|
99
105
|
- mike@blowmage.com
|
@@ -104,9 +110,9 @@ extra_rdoc_files:
|
|
104
110
|
- Manifest.txt
|
105
111
|
- README.rdoc
|
106
112
|
files:
|
107
|
-
- .autotest
|
108
|
-
- .gemtest
|
109
|
-
- .travis.yml
|
113
|
+
- ".autotest"
|
114
|
+
- ".gemtest"
|
115
|
+
- ".travis.yml"
|
110
116
|
- CHANGELOG.rdoc
|
111
117
|
- Gemfile
|
112
118
|
- LICENSE
|
@@ -188,23 +194,23 @@ licenses:
|
|
188
194
|
metadata: {}
|
189
195
|
post_install_message:
|
190
196
|
rdoc_options:
|
191
|
-
- --main
|
197
|
+
- "--main"
|
192
198
|
- README.rdoc
|
193
199
|
require_paths:
|
194
200
|
- lib
|
195
201
|
required_ruby_version: !ruby/object:Gem::Requirement
|
196
202
|
requirements:
|
197
|
-
- -
|
203
|
+
- - ">="
|
198
204
|
- !ruby/object:Gem::Version
|
199
205
|
version: '0'
|
200
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
207
|
requirements:
|
202
|
-
- -
|
208
|
+
- - ">="
|
203
209
|
- !ruby/object:Gem::Version
|
204
|
-
version:
|
210
|
+
version: '0'
|
205
211
|
requirements: []
|
206
|
-
rubyforge_project:
|
207
|
-
rubygems_version: 2.
|
212
|
+
rubyforge_project:
|
213
|
+
rubygems_version: 2.2.2
|
208
214
|
signing_key:
|
209
215
|
specification_version: 4
|
210
216
|
summary: MiniTest integration for Rails 3 and 4
|