minitest-rails 3.0.0.rc1 → 3.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 +1 -1
- data/CHANGELOG.rdoc +11 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +13 -21
- data/Rakefile +1 -1
- data/gemfiles/5.0.gemfile +1 -1
- data/lib/generators/minitest.rb +5 -1
- data/lib/minitest/rails.rb +56 -9
- data/lib/minitest/rails/assertions.rb +0 -344
- data/lib/minitest/rails/controller.rb +14 -0
- data/lib/minitest/rails/expectations.rb +0 -124
- data/lib/minitest/rails/version.rb +1 -1
- data/minitest-rails.gemspec +8 -8
- data/tasks/test.rake +14 -8
- data/test/generators/test_controller_generator.rb +5 -5
- data/test/generators/test_generator_generator.rb +5 -5
- data/test/generators/test_helper_generator.rb +4 -4
- data/test/generators/test_job_generator.rb +4 -4
- data/test/generators/test_mailer_generator.rb +4 -4
- data/test/generators/test_model_generator.rb +7 -7
- data/test/generators/test_scaffold_generator.rb +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4d24ef4761098d8b1b988493155fb73ba0c480a
|
4
|
+
data.tar.gz: a6c181821e2331d20f05698fb632650c61d50db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25066c06f3a6097e3a026b8576f3dc69a1b38988f37640f4ecb59868775d54ebfa67e7ff5150b74b12cd60fa28d1f22c17f236bbffbf7ad087c4a07937200892
|
7
|
+
data.tar.gz: 567cda05348d00933ff39b9175011b58315a83ac4c7959df168ed8264c7bce9d2b54fc1d46b086a742268f007c99fb06a0678ad86cf7e209837206a96f7ab1c2
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
=== 3.0.0 / 2016-07-01
|
2
|
+
|
3
|
+
* Support Rails 5
|
4
|
+
|
5
|
+
* The spec DSL is now default.
|
6
|
+
* Controller specs now use ActionDispatch::IntegrationTest.
|
7
|
+
* Controller specs optionally use ActionController::TestCase when
|
8
|
+
rails-controller-testing gem is present.
|
9
|
+
|
10
|
+
https://github.com/blowmage/minitest-rails/compare/v2.2.0...v3.0.0
|
11
|
+
|
1
12
|
=== 2.2.0 / 2015-05-29
|
2
13
|
|
3
14
|
* Update to Minitest 5.7
|
data/Manifest.txt
CHANGED
@@ -43,6 +43,7 @@ lib/minitest-rails.rb
|
|
43
43
|
lib/minitest/rails.rb
|
44
44
|
lib/minitest/rails/assertions.rb
|
45
45
|
lib/minitest/rails/constant_lookup.rb
|
46
|
+
lib/minitest/rails/controller.rb
|
46
47
|
lib/minitest/rails/expectations.rb
|
47
48
|
lib/minitest/rails/railtie.rb
|
48
49
|
lib/minitest/rails/version.rb
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= minitest-rails
|
2
2
|
|
3
|
-
Minitest integration for Rails
|
3
|
+
Minitest integration for Rails 5
|
4
4
|
|
5
5
|
{<img src="https://secure.travis-ci.org/blowmage/minitest-rails.png" alt="Build Status" />}[http://travis-ci.org/blowmage/minitest-rails]
|
6
6
|
{<img src="https://codeclimate.com/github/blowmage/minitest-rails.png" />}[https://codeclimate.com/github/blowmage/minitest-rails]
|
@@ -24,6 +24,10 @@ Add <tt>minitest-rails</tt> to the Gemfile:
|
|
24
24
|
|
25
25
|
gem "minitest-rails"
|
26
26
|
|
27
|
+
If you are running Rails 4.1 or 4.2, be sure to specify a 2.x release in the Gemfile:
|
28
|
+
|
29
|
+
gem "minitest-rails", "~> 1.0"
|
30
|
+
|
27
31
|
If you are running Rails 4.0 or earlier, be sure to specify a 1.x release in the Gemfile:
|
28
32
|
|
29
33
|
gem "minitest-rails", "~> 1.0"
|
@@ -38,13 +42,13 @@ This will add the <tt>test_helper.rb</tt> file to the <tt>test</tt> directory.
|
|
38
42
|
|
39
43
|
This project aims to enable Minitest within the Rails TestCase classes.
|
40
44
|
Your test will continue to inherit from <tt>ActiveSupport::TestCase</tt>, which will now support the spec DSL.
|
41
|
-
You can generate test files with the standard model, controller, resource, and other generators:
|
45
|
+
You can generate test files using the <tt>Minitest::Spec</tt> DSL with the standard model, controller, resource, and other generators:
|
42
46
|
|
43
47
|
rails generate model User
|
44
48
|
|
45
|
-
And you can specify generating the tests
|
49
|
+
And you can specify generating the tests without the <tt>Minitest::Spec</tt> DSL on any of the generators by providing the <tt>--no-spec</tt> option:
|
46
50
|
|
47
|
-
rails generate model User --spec
|
51
|
+
rails generate model User --no-spec
|
48
52
|
|
49
53
|
And you can specify not generating the fixture for a model by providing the <tt>--skip-fixture</tt> option:
|
50
54
|
|
@@ -53,22 +57,16 @@ And you can specify not generating the fixture for a model by providing the <tt>
|
|
53
57
|
You can also set these as defaults by adding the following to the <tt>config/application.rb</tt> file:
|
54
58
|
|
55
59
|
config.generators do |g|
|
56
|
-
g.test_framework :minitest, spec:
|
60
|
+
g.test_framework :minitest, spec: false, fixture: false
|
57
61
|
end
|
58
|
-
|
59
|
-
== Running Tests
|
60
|
-
|
61
|
-
To run your tests use the <tt>rake test</tt> that ship with rails. For a complete list run <tt>rake -T</tt>.
|
62
62
|
|
63
|
-
|
63
|
+
== Running Tests
|
64
64
|
|
65
|
-
|
66
|
-
t.pattern = "test/presenters/**/*_test.rb"
|
67
|
-
end
|
65
|
+
To run your tests use the <tt>rails test</tt> that ship with rails.
|
68
66
|
|
69
|
-
|
67
|
+
== Using Rails 4.1 or 4.2
|
70
68
|
|
71
|
-
|
69
|
+
For information on using minitest-rails with Rails 4.1 and 4.2, see the README for the 2.x branch: https://github.com/blowmage/minitest-rails/tree/2.x#readme
|
72
70
|
|
73
71
|
== Using Rails 4.0 or earlier
|
74
72
|
|
@@ -78,12 +76,6 @@ For information on using minitest-rails with Rails 3.0 through 4.0, see the READ
|
|
78
76
|
|
79
77
|
You can use Capybara for feature tests by adding <tt>minitest-rails-capybara</tt> as a dependency. See the README for more information: https://github.com/blowmage/minitest-rails-capybara
|
80
78
|
|
81
|
-
== RSpec Compatibility
|
82
|
-
|
83
|
-
RSpec and Minitest's spec DSL are incompatible and both cannot be loaded at the same time. If your tests using the spec DSL are not running it is likely the RSpec DSL is also loaded. Check the dependencies and make sure RSpec is only loaded when running the specs.
|
84
|
-
|
85
|
-
If you need to use some RSpec features with minitest-rails require only the needed gems. e.g. To use RSpec mocks with minitest-rails require the "rspec-mocks" gem only, and not the main "rspec" gem which activates the RSpec DSL.
|
86
|
-
|
87
79
|
== Get Involved
|
88
80
|
|
89
81
|
Join the mailing list to get help or offer suggestions.
|
data/Rakefile
CHANGED
data/gemfiles/5.0.gemfile
CHANGED
data/lib/generators/minitest.rb
CHANGED
@@ -3,12 +3,16 @@ require 'rails/generators/named_base'
|
|
3
3
|
module Minitest
|
4
4
|
module Generators
|
5
5
|
class Base < ::Rails::Generators::NamedBase #:nodoc:
|
6
|
-
class_option :spec, type: :boolean, default:
|
6
|
+
class_option :spec, type: :boolean, default: true,
|
7
7
|
desc: "Use Minitest::Spec DSL"
|
8
8
|
|
9
9
|
def self.default_source_root
|
10
10
|
File.expand_path(File.join(File.dirname(__FILE__), 'minitest', generator_name, 'templates'))
|
11
11
|
end
|
12
|
+
|
13
|
+
def show_helper
|
14
|
+
"#{singular_table_name}_url(#{singular_table_name})"
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
data/lib/minitest/rails.rb
CHANGED
@@ -4,6 +4,21 @@ require "minitest/spec"
|
|
4
4
|
require "minitest/mock"
|
5
5
|
require "minitest/hell" if ENV["MT_HELL"]
|
6
6
|
|
7
|
+
################################################################################
|
8
|
+
# Do we support old school controller tests?
|
9
|
+
################################################################################
|
10
|
+
|
11
|
+
module Minitest
|
12
|
+
module Rails
|
13
|
+
def self.controller_tests?
|
14
|
+
require "rails-controller-testing"
|
15
|
+
return true
|
16
|
+
rescue LoadError
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
7
22
|
################################################################################
|
8
23
|
# Add and configure the spec DSL
|
9
24
|
################################################################################
|
@@ -36,6 +51,30 @@ class ActiveSupport::TestCase
|
|
36
51
|
end
|
37
52
|
end
|
38
53
|
|
54
|
+
if Minitest::Rails.controller_tests?
|
55
|
+
require "action_controller/test_case"
|
56
|
+
require "minitest/rails/controller"
|
57
|
+
class ActionController::TestCase
|
58
|
+
# Use AC::TestCase for the base class when describing a controller
|
59
|
+
register_spec_type(self) do |desc|
|
60
|
+
Class === desc && desc < ActionController::Metal
|
61
|
+
end
|
62
|
+
register_spec_type(/Controller( ?Test)?\z/i, self)
|
63
|
+
register_spec_type(self) do |desc, *addl|
|
64
|
+
addl.include? :controller
|
65
|
+
end
|
66
|
+
|
67
|
+
# Resolve the controller from the test name when using the spec DSL
|
68
|
+
def self.determine_default_controller_class(name)
|
69
|
+
controller = determine_constant_from_test_name(name) do |constant|
|
70
|
+
Class === constant && constant < ActionController::Metal
|
71
|
+
end
|
72
|
+
raise NameError.new("Unable to resolve controller for #{name}") if controller.nil?
|
73
|
+
controller
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
39
78
|
require "action_view/test_case"
|
40
79
|
class ActionView::TestCase
|
41
80
|
# Use AV::TestCase for the base class for helpers and views
|
@@ -92,15 +131,23 @@ end
|
|
92
131
|
|
93
132
|
require "action_dispatch/testing/integration"
|
94
133
|
class ActionDispatch::IntegrationTest
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
134
|
+
if Minitest::Rails.controller_tests?
|
135
|
+
# Register by Integration name only
|
136
|
+
register_spec_type(/Integration( ?Test)?\z/i, self)
|
137
|
+
register_spec_type(self) do |desc, *addl|
|
138
|
+
addl.include? :integration
|
139
|
+
end
|
140
|
+
else
|
141
|
+
# Use AD::IntegrationTest for the base class when describing a controller
|
142
|
+
register_spec_type(self) do |desc|
|
143
|
+
Class === desc && desc < ActionController::Metal
|
144
|
+
end
|
145
|
+
# Register by name, either Integration or Controller
|
146
|
+
register_spec_type(/(Integration|Controller)( ?Test)?\z/i, self)
|
147
|
+
register_spec_type(self) do |desc, *addl|
|
148
|
+
addl.include?(:integration) ||
|
149
|
+
addl.include?(:controller)
|
150
|
+
end
|
104
151
|
end
|
105
152
|
end
|
106
153
|
|
@@ -118,41 +118,6 @@ class ActionView::TestCase
|
|
118
118
|
# :method: assert_redirected_to
|
119
119
|
# :call-seq: assert_redirected_to(options = {}, message=nil)
|
120
120
|
|
121
|
-
##
|
122
|
-
# Asserts that the request was rendered with the appropriate template file or partials.
|
123
|
-
#
|
124
|
-
# # assert that the "new" view template was rendered
|
125
|
-
# assert_template "new"
|
126
|
-
#
|
127
|
-
# # assert that the exact template "admin/posts/new" was rendered
|
128
|
-
# assert_template %r{\Aadmin/posts/new\Z}
|
129
|
-
#
|
130
|
-
# # assert that the layout 'admin' was rendered
|
131
|
-
# assert_template layout: 'admin'
|
132
|
-
# assert_template layout: 'layouts/admin'
|
133
|
-
# assert_template layout: :admin
|
134
|
-
#
|
135
|
-
# # assert that no layout was rendered
|
136
|
-
# assert_template layout: nil
|
137
|
-
# assert_template layout: false
|
138
|
-
#
|
139
|
-
# # assert that the "_customer" partial was rendered twice
|
140
|
-
# assert_template partial: '_customer', count: 2
|
141
|
-
#
|
142
|
-
# # assert that no partials were rendered
|
143
|
-
# assert_template partial: false
|
144
|
-
#
|
145
|
-
# In a view test case, you can also assert that specific locals are passed
|
146
|
-
# to partials:
|
147
|
-
#
|
148
|
-
# # assert that the "_customer" partial was rendered with a specific object
|
149
|
-
# assert_template partial: '_customer', locals: { customer: @customer }
|
150
|
-
#
|
151
|
-
# See also Minitest::Rails::Expectations#must_render_template
|
152
|
-
#
|
153
|
-
# :method: assert_template
|
154
|
-
# :call-seq: assert_template(options = {}, message = nil)
|
155
|
-
|
156
121
|
##
|
157
122
|
# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
|
158
123
|
# The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in
|
@@ -427,143 +392,6 @@ class ActionView::TestCase
|
|
427
392
|
# :method: assert_dom_equal
|
428
393
|
# :call-seq: assert_dom_equal(expected, actual, message = nil)
|
429
394
|
alias :refute_dom_equal :assert_dom_not_equal
|
430
|
-
|
431
|
-
##
|
432
|
-
# Asserts that there is a tag/node/element in the body of the response
|
433
|
-
# that meets all of the given conditions. The +conditions+ parameter must
|
434
|
-
# be a hash of any of the following keys (all are optional):
|
435
|
-
#
|
436
|
-
# * <tt>:tag</tt>: the node type must match the corresponding value
|
437
|
-
# * <tt>:attributes</tt>: a hash. The node's attributes must match the
|
438
|
-
# corresponding values in the hash.
|
439
|
-
# * <tt>:parent</tt>: a hash. The node's parent must match the
|
440
|
-
# corresponding hash.
|
441
|
-
# * <tt>:child</tt>: a hash. At least one of the node's immediate children
|
442
|
-
# must meet the criteria described by the hash.
|
443
|
-
# * <tt>:ancestor</tt>: a hash. At least one of the node's ancestors must
|
444
|
-
# meet the criteria described by the hash.
|
445
|
-
# * <tt>:descendant</tt>: a hash. At least one of the node's descendants
|
446
|
-
# must meet the criteria described by the hash.
|
447
|
-
# * <tt>:sibling</tt>: a hash. At least one of the node's siblings must
|
448
|
-
# meet the criteria described by the hash.
|
449
|
-
# * <tt>:after</tt>: a hash. The node must be after any sibling meeting
|
450
|
-
# the criteria described by the hash, and at least one sibling must match.
|
451
|
-
# * <tt>:before</tt>: a hash. The node must be before any sibling meeting
|
452
|
-
# the criteria described by the hash, and at least one sibling must match.
|
453
|
-
# * <tt>:children</tt>: a hash, for counting children of a node. Accepts
|
454
|
-
# the keys:
|
455
|
-
# * <tt>:count</tt>: either a number or a range which must equal (or
|
456
|
-
# include) the number of children that match.
|
457
|
-
# * <tt>:less_than</tt>: the number of matching children must be less
|
458
|
-
# than this number.
|
459
|
-
# * <tt>:greater_than</tt>: the number of matching children must be
|
460
|
-
# greater than this number.
|
461
|
-
# * <tt>:only</tt>: another hash consisting of the keys to use
|
462
|
-
# to match on the children, and only matching children will be
|
463
|
-
# counted.
|
464
|
-
# * <tt>:content</tt>: the textual content of the node must match the
|
465
|
-
# given value. This will not match HTML tags in the body of a
|
466
|
-
# tag--only text.
|
467
|
-
#
|
468
|
-
# Conditions are matched using the following algorithm:
|
469
|
-
#
|
470
|
-
# * if the condition is a string, it must be a substring of the value.
|
471
|
-
# * if the condition is a regexp, it must match the value.
|
472
|
-
# * if the condition is a number, the value must match number.to_s.
|
473
|
-
# * if the condition is +true+, the value must not be +nil+.
|
474
|
-
# * if the condition is +false+ or +nil+, the value must be +nil+.
|
475
|
-
#
|
476
|
-
# # Assert that there is a "span" tag
|
477
|
-
# assert_tag tag: "span"
|
478
|
-
#
|
479
|
-
# # Assert that there is a "span" tag with id="x"
|
480
|
-
# assert_tag tag: "span", attributes: { id: "x" }
|
481
|
-
#
|
482
|
-
# # Assert that there is a "span" tag using the short-hand
|
483
|
-
# assert_tag :span
|
484
|
-
#
|
485
|
-
# # Assert that there is a "span" tag with id="x" using the short-hand
|
486
|
-
# assert_tag :span, attributes: { id: "x" }
|
487
|
-
#
|
488
|
-
# # Assert that there is a "span" inside of a "div"
|
489
|
-
# assert_tag tag: "span", parent: { tag: "div" }
|
490
|
-
#
|
491
|
-
# # Assert that there is a "span" somewhere inside a table
|
492
|
-
# assert_tag tag: "span", ancestor: { tag: "table" }
|
493
|
-
#
|
494
|
-
# # Assert that there is a "span" with at least one "em" child
|
495
|
-
# assert_tag tag: "span", child: { tag: "em" }
|
496
|
-
#
|
497
|
-
# # Assert that there is a "span" containing a (possibly nested)
|
498
|
-
# # "strong" tag.
|
499
|
-
# assert_tag tag: "span", descendant: { tag: "strong" }
|
500
|
-
#
|
501
|
-
# # Assert that there is a "span" containing between 2 and 4 "em" tags
|
502
|
-
# # as immediate children
|
503
|
-
# assert_tag tag: "span",
|
504
|
-
# children: { count: 2..4, only: { tag: "em" } }
|
505
|
-
#
|
506
|
-
# # Get funky: assert that there is a "div", with an "ul" ancestor
|
507
|
-
# # and an "li" parent (with "class" = "enum"), and containing a
|
508
|
-
# # "span" descendant that contains text matching /hello world/
|
509
|
-
# assert_tag tag: "div",
|
510
|
-
# ancestor: { tag: "ul" },
|
511
|
-
# parent: { tag: "li",
|
512
|
-
# attributes: { class: "enum" } },
|
513
|
-
# descendant: { tag: "span",
|
514
|
-
# child: /hello world/ }
|
515
|
-
#
|
516
|
-
# <b>Please note</b>: +assert_tag+ and +assert_no_tag+ only work
|
517
|
-
# with well-formed XHTML. They recognize a few tags as implicitly self-closing
|
518
|
-
# (like br and hr and such) but will not work correctly with tags
|
519
|
-
# that allow optional closing tags (p, li, td). <em>You must explicitly
|
520
|
-
# close all of your tags to use these assertions.</em>
|
521
|
-
#
|
522
|
-
# See also Minitest::Rails::Expectations#must_have_tag
|
523
|
-
#
|
524
|
-
# :method: assert_tag
|
525
|
-
# :call-seq: assert_tag(*opts)
|
526
|
-
|
527
|
-
##
|
528
|
-
# Identical to +assert_tag+, but asserts that a matching tag does _not_
|
529
|
-
# exist. (See +assert_tag+ for a full discussion of the syntax.)
|
530
|
-
#
|
531
|
-
# # Assert that there is not a "div" containing a "p"
|
532
|
-
# assert_no_tag tag: "div", descendant: { tag: "p" }
|
533
|
-
#
|
534
|
-
# # Assert that an unordered list is empty
|
535
|
-
# assert_no_tag tag: "ul", descendant: { tag: "li" }
|
536
|
-
#
|
537
|
-
# # Assert that there is not a "p" tag with between 1 to 3 "img" tags
|
538
|
-
# # as immediate children
|
539
|
-
# assert_no_tag tag: "p",
|
540
|
-
# children: { count: 1..3, only: { tag: "img" } }
|
541
|
-
#
|
542
|
-
# See also Minitest::Rails::Expectations#wont_have_tag
|
543
|
-
#
|
544
|
-
# :method: assert_no_tag
|
545
|
-
# :call-seq: assert_no_tag(*opts)
|
546
|
-
|
547
|
-
##
|
548
|
-
# Identical to +assert_tag+, but asserts that a matching tag does _not_
|
549
|
-
# exist. (See +assert_tag+ for a full discussion of the syntax.)
|
550
|
-
#
|
551
|
-
# # Assert that there is not a "div" containing a "p"
|
552
|
-
# assert_no_tag tag: "div", descendant: { tag: "p" }
|
553
|
-
#
|
554
|
-
# # Assert that an unordered list is empty
|
555
|
-
# assert_no_tag tag: "ul", descendant: { tag: "li" }
|
556
|
-
#
|
557
|
-
# # Assert that there is not a "p" tag with between 1 to 3 "img" tags
|
558
|
-
# # as immediate children
|
559
|
-
# assert_no_tag tag: "p",
|
560
|
-
# children: { count: 1..3, only: { tag: "img" } }
|
561
|
-
#
|
562
|
-
# See also Minitest::Rails::Expectations#wont_have_tag
|
563
|
-
#
|
564
|
-
# :method: refute_tag
|
565
|
-
# :call-seq: refute_tag(*opts)
|
566
|
-
alias :refute_tag :assert_no_tag
|
567
395
|
end
|
568
396
|
|
569
397
|
class ActionDispatch::IntegrationTest
|
@@ -647,41 +475,6 @@ class ActionDispatch::IntegrationTest
|
|
647
475
|
# :method: assert_redirected_to
|
648
476
|
# :call-seq: assert_redirected_to(options = {}, message=nil)
|
649
477
|
|
650
|
-
##
|
651
|
-
# Asserts that the request was rendered with the appropriate template file or partials.
|
652
|
-
#
|
653
|
-
# # assert that the "new" view template was rendered
|
654
|
-
# assert_template "new"
|
655
|
-
#
|
656
|
-
# # assert that the exact template "admin/posts/new" was rendered
|
657
|
-
# assert_template %r{\Aadmin/posts/new\Z}
|
658
|
-
#
|
659
|
-
# # assert that the layout 'admin' was rendered
|
660
|
-
# assert_template layout: 'admin'
|
661
|
-
# assert_template layout: 'layouts/admin'
|
662
|
-
# assert_template layout: :admin
|
663
|
-
#
|
664
|
-
# # assert that no layout was rendered
|
665
|
-
# assert_template layout: nil
|
666
|
-
# assert_template layout: false
|
667
|
-
#
|
668
|
-
# # assert that the "_customer" partial was rendered twice
|
669
|
-
# assert_template partial: '_customer', count: 2
|
670
|
-
#
|
671
|
-
# # assert that no partials were rendered
|
672
|
-
# assert_template partial: false
|
673
|
-
#
|
674
|
-
# In a view test case, you can also assert that specific locals are passed
|
675
|
-
# to partials:
|
676
|
-
#
|
677
|
-
# # assert that the "_customer" partial was rendered with a specific object
|
678
|
-
# assert_template partial: '_customer', locals: { customer: @customer }
|
679
|
-
#
|
680
|
-
# See also Minitest::Rails::Expectations#must_render_template
|
681
|
-
#
|
682
|
-
# :method: assert_template
|
683
|
-
# :call-seq: assert_template(options = {}, message = nil)
|
684
|
-
|
685
478
|
##
|
686
479
|
# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
|
687
480
|
# The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in
|
@@ -956,143 +749,6 @@ class ActionDispatch::IntegrationTest
|
|
956
749
|
# :method: assert_dom_equal
|
957
750
|
# :call-seq: assert_dom_equal(expected, actual, message = nil)
|
958
751
|
alias :refute_dom_equal :assert_dom_not_equal
|
959
|
-
|
960
|
-
##
|
961
|
-
# Asserts that there is a tag/node/element in the body of the response
|
962
|
-
# that meets all of the given conditions. The +conditions+ parameter must
|
963
|
-
# be a hash of any of the following keys (all are optional):
|
964
|
-
#
|
965
|
-
# * <tt>:tag</tt>: the node type must match the corresponding value
|
966
|
-
# * <tt>:attributes</tt>: a hash. The node's attributes must match the
|
967
|
-
# corresponding values in the hash.
|
968
|
-
# * <tt>:parent</tt>: a hash. The node's parent must match the
|
969
|
-
# corresponding hash.
|
970
|
-
# * <tt>:child</tt>: a hash. At least one of the node's immediate children
|
971
|
-
# must meet the criteria described by the hash.
|
972
|
-
# * <tt>:ancestor</tt>: a hash. At least one of the node's ancestors must
|
973
|
-
# meet the criteria described by the hash.
|
974
|
-
# * <tt>:descendant</tt>: a hash. At least one of the node's descendants
|
975
|
-
# must meet the criteria described by the hash.
|
976
|
-
# * <tt>:sibling</tt>: a hash. At least one of the node's siblings must
|
977
|
-
# meet the criteria described by the hash.
|
978
|
-
# * <tt>:after</tt>: a hash. The node must be after any sibling meeting
|
979
|
-
# the criteria described by the hash, and at least one sibling must match.
|
980
|
-
# * <tt>:before</tt>: a hash. The node must be before any sibling meeting
|
981
|
-
# the criteria described by the hash, and at least one sibling must match.
|
982
|
-
# * <tt>:children</tt>: a hash, for counting children of a node. Accepts
|
983
|
-
# the keys:
|
984
|
-
# * <tt>:count</tt>: either a number or a range which must equal (or
|
985
|
-
# include) the number of children that match.
|
986
|
-
# * <tt>:less_than</tt>: the number of matching children must be less
|
987
|
-
# than this number.
|
988
|
-
# * <tt>:greater_than</tt>: the number of matching children must be
|
989
|
-
# greater than this number.
|
990
|
-
# * <tt>:only</tt>: another hash consisting of the keys to use
|
991
|
-
# to match on the children, and only matching children will be
|
992
|
-
# counted.
|
993
|
-
# * <tt>:content</tt>: the textual content of the node must match the
|
994
|
-
# given value. This will not match HTML tags in the body of a
|
995
|
-
# tag--only text.
|
996
|
-
#
|
997
|
-
# Conditions are matched using the following algorithm:
|
998
|
-
#
|
999
|
-
# * if the condition is a string, it must be a substring of the value.
|
1000
|
-
# * if the condition is a regexp, it must match the value.
|
1001
|
-
# * if the condition is a number, the value must match number.to_s.
|
1002
|
-
# * if the condition is +true+, the value must not be +nil+.
|
1003
|
-
# * if the condition is +false+ or +nil+, the value must be +nil+.
|
1004
|
-
#
|
1005
|
-
# # Assert that there is a "span" tag
|
1006
|
-
# assert_tag tag: "span"
|
1007
|
-
#
|
1008
|
-
# # Assert that there is a "span" tag with id="x"
|
1009
|
-
# assert_tag tag: "span", attributes: { id: "x" }
|
1010
|
-
#
|
1011
|
-
# # Assert that there is a "span" tag using the short-hand
|
1012
|
-
# assert_tag :span
|
1013
|
-
#
|
1014
|
-
# # Assert that there is a "span" tag with id="x" using the short-hand
|
1015
|
-
# assert_tag :span, attributes: { id: "x" }
|
1016
|
-
#
|
1017
|
-
# # Assert that there is a "span" inside of a "div"
|
1018
|
-
# assert_tag tag: "span", parent: { tag: "div" }
|
1019
|
-
#
|
1020
|
-
# # Assert that there is a "span" somewhere inside a table
|
1021
|
-
# assert_tag tag: "span", ancestor: { tag: "table" }
|
1022
|
-
#
|
1023
|
-
# # Assert that there is a "span" with at least one "em" child
|
1024
|
-
# assert_tag tag: "span", child: { tag: "em" }
|
1025
|
-
#
|
1026
|
-
# # Assert that there is a "span" containing a (possibly nested)
|
1027
|
-
# # "strong" tag.
|
1028
|
-
# assert_tag tag: "span", descendant: { tag: "strong" }
|
1029
|
-
#
|
1030
|
-
# # Assert that there is a "span" containing between 2 and 4 "em" tags
|
1031
|
-
# # as immediate children
|
1032
|
-
# assert_tag tag: "span",
|
1033
|
-
# children: { count: 2..4, only: { tag: "em" } }
|
1034
|
-
#
|
1035
|
-
# # Get funky: assert that there is a "div", with an "ul" ancestor
|
1036
|
-
# # and an "li" parent (with "class" = "enum"), and containing a
|
1037
|
-
# # "span" descendant that contains text matching /hello world/
|
1038
|
-
# assert_tag tag: "div",
|
1039
|
-
# ancestor: { tag: "ul" },
|
1040
|
-
# parent: { tag: "li",
|
1041
|
-
# attributes: { class: "enum" } },
|
1042
|
-
# descendant: { tag: "span",
|
1043
|
-
# child: /hello world/ }
|
1044
|
-
#
|
1045
|
-
# <b>Please note</b>: +assert_tag+ and +assert_no_tag+ only work
|
1046
|
-
# with well-formed XHTML. They recognize a few tags as implicitly self-closing
|
1047
|
-
# (like br and hr and such) but will not work correctly with tags
|
1048
|
-
# that allow optional closing tags (p, li, td). <em>You must explicitly
|
1049
|
-
# close all of your tags to use these assertions.</em>
|
1050
|
-
#
|
1051
|
-
# See also Minitest::Rails::Expectations#must_have_tag
|
1052
|
-
#
|
1053
|
-
# :method: assert_tag
|
1054
|
-
# :call-seq: assert_tag(*opts)
|
1055
|
-
|
1056
|
-
##
|
1057
|
-
# Identical to +assert_tag+, but asserts that a matching tag does _not_
|
1058
|
-
# exist. (See +assert_tag+ for a full discussion of the syntax.)
|
1059
|
-
#
|
1060
|
-
# # Assert that there is not a "div" containing a "p"
|
1061
|
-
# assert_no_tag tag: "div", descendant: { tag: "p" }
|
1062
|
-
#
|
1063
|
-
# # Assert that an unordered list is empty
|
1064
|
-
# assert_no_tag tag: "ul", descendant: { tag: "li" }
|
1065
|
-
#
|
1066
|
-
# # Assert that there is not a "p" tag with between 1 to 3 "img" tags
|
1067
|
-
# # as immediate children
|
1068
|
-
# assert_no_tag tag: "p",
|
1069
|
-
# children: { count: 1..3, only: { tag: "img" } }
|
1070
|
-
#
|
1071
|
-
# See also Minitest::Rails::Expectations#wont_have_tag
|
1072
|
-
#
|
1073
|
-
# :method: assert_no_tag
|
1074
|
-
# :call-seq: assert_no_tag(*opts)
|
1075
|
-
|
1076
|
-
##
|
1077
|
-
# Identical to +assert_tag+, but asserts that a matching tag does _not_
|
1078
|
-
# exist. (See +assert_tag+ for a full discussion of the syntax.)
|
1079
|
-
#
|
1080
|
-
# # Assert that there is not a "div" containing a "p"
|
1081
|
-
# assert_no_tag tag: "div", descendant: { tag: "p" }
|
1082
|
-
#
|
1083
|
-
# # Assert that an unordered list is empty
|
1084
|
-
# assert_no_tag tag: "ul", descendant: { tag: "li" }
|
1085
|
-
#
|
1086
|
-
# # Assert that there is not a "p" tag with between 1 to 3 "img" tags
|
1087
|
-
# # as immediate children
|
1088
|
-
# assert_no_tag tag: "p",
|
1089
|
-
# children: { count: 1..3, only: { tag: "img" } }
|
1090
|
-
#
|
1091
|
-
# See also Minitest::Rails::Expectations#wont_have_tag
|
1092
|
-
#
|
1093
|
-
# :method: refute_tag
|
1094
|
-
# :call-seq: refute_tag(*opts)
|
1095
|
-
alias :refute_tag :assert_no_tag
|
1096
752
|
end
|
1097
753
|
|
1098
754
|
if defined? ActiveJob
|
@@ -0,0 +1,14 @@
|
|
1
|
+
##
|
2
|
+
# Include the expectation aliases to calls on AC::TC will work.
|
3
|
+
# Other assertions and expectations are already inherited.
|
4
|
+
# No need to provide docs, we don't want to advertise this support.
|
5
|
+
#
|
6
|
+
|
7
|
+
class ActionController::TestCase # :nodoc:
|
8
|
+
alias :must_respond_with :assert_response
|
9
|
+
alias :must_redirect_to :assert_redirected_to
|
10
|
+
alias :must_render_template :assert_template
|
11
|
+
alias :must_select :assert_select
|
12
|
+
alias :must_select_email :assert_select_email
|
13
|
+
alias :must_select_encoded :assert_select_encoded
|
14
|
+
end
|
@@ -362,126 +362,6 @@ module Minitest::Rails::Expectations
|
|
362
362
|
# :args: expected, message = nil
|
363
363
|
infect_an_assertion :refute_dom_equal, :wont_dom_equal
|
364
364
|
|
365
|
-
##
|
366
|
-
# Expects that there is a tag/node/element in the body of the response
|
367
|
-
# that meets all of the given conditions. The +conditions+ parameter must
|
368
|
-
# be a hash of any of the following keys (all are optional):
|
369
|
-
#
|
370
|
-
# * <tt>:tag</tt>: the node type must match the corresponding value
|
371
|
-
# * <tt>:attributes</tt>: a hash. The node's attributes must match the
|
372
|
-
# corresponding values in the hash.
|
373
|
-
# * <tt>:parent</tt>: a hash. The node's parent must match the
|
374
|
-
# corresponding hash.
|
375
|
-
# * <tt>:child</tt>: a hash. At least one of the node's immediate children
|
376
|
-
# must meet the criteria described by the hash.
|
377
|
-
# * <tt>:ancestor</tt>: a hash. At least one of the node's ancestors must
|
378
|
-
# meet the criteria described by the hash.
|
379
|
-
# * <tt>:descendant</tt>: a hash. At least one of the node's descendants
|
380
|
-
# must meet the criteria described by the hash.
|
381
|
-
# * <tt>:sibling</tt>: a hash. At least one of the node's siblings must
|
382
|
-
# meet the criteria described by the hash.
|
383
|
-
# * <tt>:after</tt>: a hash. The node must be after any sibling meeting
|
384
|
-
# the criteria described by the hash, and at least one sibling must match.
|
385
|
-
# * <tt>:before</tt>: a hash. The node must be before any sibling meeting
|
386
|
-
# the criteria described by the hash, and at least one sibling must match.
|
387
|
-
# * <tt>:children</tt>: a hash, for counting children of a node. Accepts
|
388
|
-
# the keys:
|
389
|
-
# * <tt>:count</tt>: either a number or a range which must equal (or
|
390
|
-
# include) the number of children that match.
|
391
|
-
# * <tt>:less_than</tt>: the number of matching children must be less
|
392
|
-
# than this number.
|
393
|
-
# * <tt>:greater_than</tt>: the number of matching children must be
|
394
|
-
# greater than this number.
|
395
|
-
# * <tt>:only</tt>: another hash consisting of the keys to use
|
396
|
-
# to match on the children, and only matching children will be
|
397
|
-
# counted.
|
398
|
-
# * <tt>:content</tt>: the textual content of the node must match the
|
399
|
-
# given value. This will not match HTML tags in the body of a
|
400
|
-
# tag--only text.
|
401
|
-
#
|
402
|
-
# Conditions are matched using the following algorithm:
|
403
|
-
#
|
404
|
-
# * if the condition is a string, it must be a substring of the value.
|
405
|
-
# * if the condition is a regexp, it must match the value.
|
406
|
-
# * if the condition is a number, the value must match number.to_s.
|
407
|
-
# * if the condition is +true+, the value must not be +nil+.
|
408
|
-
# * if the condition is +false+ or +nil+, the value must be +nil+.
|
409
|
-
#
|
410
|
-
# # Expect that there is a "span" tag
|
411
|
-
# must_have_tag tag: "span"
|
412
|
-
#
|
413
|
-
# # Expect that there is a "span" tag with id="x"
|
414
|
-
# must_have_tag tag: "span", attributes: { id: "x" }
|
415
|
-
#
|
416
|
-
# # Expect that there is a "span" tag using the short-hand
|
417
|
-
# must_have_tag :span
|
418
|
-
#
|
419
|
-
# # Expect that there is a "span" tag with id="x" using the short-hand
|
420
|
-
# must_have_tag :span, attributes: { id: "x" }
|
421
|
-
#
|
422
|
-
# # Expect that there is a "span" inside of a "div"
|
423
|
-
# must_have_tag tag: "span", parent: { tag: "div" }
|
424
|
-
#
|
425
|
-
# # Expect that there is a "span" somewhere inside a table
|
426
|
-
# must_have_tag tag: "span", ancestor: { tag: "table" }
|
427
|
-
#
|
428
|
-
# # Expect that there is a "span" with at least one "em" child
|
429
|
-
# must_have_tag tag: "span", child: { tag: "em" }
|
430
|
-
#
|
431
|
-
# # Expect that there is a "span" containing a (possibly nested)
|
432
|
-
# # "strong" tag.
|
433
|
-
# must_have_tag tag: "span", descendant: { tag: "strong" }
|
434
|
-
#
|
435
|
-
# # Expect that there is a "span" containing between 2 and 4 "em" tags
|
436
|
-
# # as immediate children
|
437
|
-
# must_have_tag tag: "span",
|
438
|
-
# children: { count: 2..4, only: { tag: "em" } }
|
439
|
-
#
|
440
|
-
# # Get funky: assert that there is a "div", with an "ul" ancestor
|
441
|
-
# # and an "li" parent (with "class" = "enum"), and containing a
|
442
|
-
# # "span" descendant that contains text matching /hello world/
|
443
|
-
# must_have_tag tag: "div",
|
444
|
-
# ancestor: { tag: "ul" },
|
445
|
-
# parent: { tag: "li",
|
446
|
-
# attributes: { class: "enum" } },
|
447
|
-
# descendant: { tag: "span",
|
448
|
-
# child: /hello world/ }
|
449
|
-
#
|
450
|
-
# <b>Please note</b>: +must_have_tag+ and +wont_have_tag+ only work
|
451
|
-
# with well-formed XHTML. They recognize a few tags as implicitly self-closing
|
452
|
-
# (like br and hr and such) but will not work correctly with tags
|
453
|
-
# that allow optional closing tags (p, li, td). <em>You must explicitly
|
454
|
-
# close all of your tags to use these assertions.</em>
|
455
|
-
#
|
456
|
-
# See also ActionView::TestCase#assert_tag
|
457
|
-
# See also ActionDispatch::IntegrationTest#assert_tag
|
458
|
-
#
|
459
|
-
# :method: must_have_tag
|
460
|
-
# :call-seq: must_have_tag(*opts)
|
461
|
-
|
462
|
-
##
|
463
|
-
# Identical to +must_have_tag+, but asserts that a matching tag does _not_
|
464
|
-
# exist. (See +must_have_tag+ for a full discussion of the syntax.)
|
465
|
-
#
|
466
|
-
# # Expect that there is not a "div" containing a "p"
|
467
|
-
# wont_have_tag tag: "div", descendant: { tag: "p" }
|
468
|
-
#
|
469
|
-
# # Expect that an unordered list is empty
|
470
|
-
# wont_have_tag tag: "ul", descendant: { tag: "li" }
|
471
|
-
#
|
472
|
-
# # Expect that there is not a "p" tag with between 1 to 3 "img" tags
|
473
|
-
# # as immediate children
|
474
|
-
# wont_have_tag tag: "p",
|
475
|
-
# children: { count: 1..3, only: { tag: "img" } }
|
476
|
-
#
|
477
|
-
# See also ActionView::TestCase#refute_tag
|
478
|
-
# See also ActionDispatch::IntegrationTest#refute_tag
|
479
|
-
# See also ActionView::TestCase#assert_no_tag
|
480
|
-
# See also ActionDispatch::IntegrationTest#assert_no_tag
|
481
|
-
#
|
482
|
-
# :method: wont_have_tag
|
483
|
-
# :call-seq: wont_have_tag(*opts)
|
484
|
-
|
485
365
|
if defined?(::ActiveJob)
|
486
366
|
##############################################################################
|
487
367
|
# ActiveJob Expectations
|
@@ -668,8 +548,6 @@ unless ENV["MT_NO_EXPECTATIONS"]
|
|
668
548
|
class ActionView::TestCase # :nodoc:
|
669
549
|
alias :must_respond_with :assert_response
|
670
550
|
alias :must_redirect_to :assert_redirected_to
|
671
|
-
alias :must_have_tag :assert_tag
|
672
|
-
alias :wont_have_tag :assert_no_tag
|
673
551
|
alias :must_select :assert_select
|
674
552
|
alias :must_select_email :assert_select_email
|
675
553
|
alias :must_select_encoded :assert_select_encoded
|
@@ -680,8 +558,6 @@ unless ENV["MT_NO_EXPECTATIONS"]
|
|
680
558
|
class ActionDispatch::IntegrationTest # :nodoc:
|
681
559
|
alias :must_respond_with :assert_response
|
682
560
|
alias :must_redirect_to :assert_redirected_to
|
683
|
-
alias :must_have_tag :assert_tag
|
684
|
-
alias :wont_have_tag :assert_no_tag
|
685
561
|
alias :must_select :assert_select
|
686
562
|
alias :must_select_email :assert_select_email
|
687
563
|
alias :must_select_encoded :assert_select_encoded
|
data/minitest-rails.gemspec
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: minitest-rails 3.0.0.
|
2
|
+
# stub: minitest-rails 3.0.0.20160701081338 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "minitest-rails".freeze
|
6
|
-
s.version = "3.0.0.
|
6
|
+
s.version = "3.0.0.20160701081338"
|
7
7
|
|
8
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Mike Moore".freeze]
|
11
|
-
s.date = "2016-
|
11
|
+
s.date = "2016-07-01"
|
12
12
|
s.description = "Adds Minitest as the default testing library in Rails".freeze
|
13
13
|
s.email = ["mike@blowmage.com".freeze]
|
14
14
|
s.extra_rdoc_files = ["CHANGELOG.rdoc".freeze, "Manifest.txt".freeze, "README.rdoc".freeze]
|
15
|
-
s.files = [".autotest".freeze, ".gemtest".freeze, ".travis.yml".freeze, "CHANGELOG.rdoc".freeze, "Gemfile".freeze, "LICENSE".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "gemfiles/5.0.gemfile".freeze, "gemfiles/head.gemfile".freeze, "lib/generators/.document".freeze, "lib/generators/minitest.rb".freeze, "lib/generators/minitest/controller/controller_generator.rb".freeze, "lib/generators/minitest/controller/templates/controller_spec.rb".freeze, "lib/generators/minitest/controller/templates/controller_test.rb".freeze, "lib/generators/minitest/generator/generator_generator.rb".freeze, "lib/generators/minitest/generator/templates/generator_spec.rb".freeze, "lib/generators/minitest/generator/templates/generator_test.rb".freeze, "lib/generators/minitest/helper/helper_generator.rb".freeze, "lib/generators/minitest/install/install_generator.rb".freeze, "lib/generators/minitest/install/templates/test_helper.rb".freeze, "lib/generators/minitest/integration/integration_generator.rb".freeze, "lib/generators/minitest/integration/templates/integration_spec.rb".freeze, "lib/generators/minitest/integration/templates/integration_test.rb".freeze, "lib/generators/minitest/job/job_generator.rb".freeze, "lib/generators/minitest/job/templates/job_spec.rb".freeze, "lib/generators/minitest/job/templates/job_test.rb".freeze, "lib/generators/minitest/mailer/mailer_generator.rb".freeze, "lib/generators/minitest/mailer/templates/mailer_spec.rb".freeze, "lib/generators/minitest/mailer/templates/mailer_test.rb".freeze, "lib/generators/minitest/mailer/templates/preview.rb".freeze, "lib/generators/minitest/model/model_generator.rb".freeze, "lib/generators/minitest/model/templates/fixtures.yml".freeze, "lib/generators/minitest/model/templates/model_spec.rb".freeze, "lib/generators/minitest/model/templates/model_test.rb".freeze, "lib/generators/minitest/scaffold/scaffold_generator.rb".freeze, "lib/generators/minitest/scaffold/templates/api_controller_spec.rb".freeze, "lib/generators/minitest/scaffold/templates/api_controller_test.rb".freeze, "lib/generators/minitest/scaffold/templates/controller_spec.rb".freeze, "lib/generators/minitest/scaffold/templates/controller_test.rb".freeze, "lib/minitest-rails.rb".freeze, "lib/minitest/rails.rb".freeze, "lib/minitest/rails/assertions.rb".freeze, "lib/minitest/rails/constant_lookup.rb".freeze, "lib/minitest/rails/expectations.rb".freeze, "lib/minitest/rails/railtie.rb".freeze, "lib/minitest/rails/version.rb".freeze, "minitest-rails.gemspec".freeze, "tasks/test.rake".freeze, "test/generators/test_controller_generator.rb".freeze, "test/generators/test_generator_generator.rb".freeze, "test/generators/test_helper_generator.rb".freeze, "test/generators/test_install_generator.rb".freeze, "test/generators/test_job_generator.rb".freeze, "test/generators/test_mailer_generator.rb".freeze, "test/generators/test_model_generator.rb".freeze, "test/generators/test_scaffold_generator.rb".freeze, "test/helper.rb".freeze, "test/rails/action_dispatch/test_assertions.rb".freeze, "test/rails/action_dispatch/test_expectations.rb".freeze, "test/rails/action_dispatch/test_spec_type.rb".freeze, "test/rails/action_mailer/test_mailers.rb".freeze, "test/rails/action_mailer/test_spec_type.rb".freeze, "test/rails/action_view/test_helpers.rb".freeze, "test/rails/action_view/test_spec_type.rb".freeze, "test/rails/active_job/test_assertions.rb".freeze, "test/rails/active_job/test_expectations.rb".freeze, "test/rails/active_job/test_spec_type.rb".freeze, "test/rails/active_support/test_assertions.rb".freeze, "test/rails/active_support/test_expectations.rb".freeze, "test/rails/active_support/test_spec_type.rb".freeze, "test/rails/generators/test_spec_type.rb".freeze, "test/rails/test_constant_lookup.rb".freeze, "test/test_sanity.rb".freeze]
|
15
|
+
s.files = [".autotest".freeze, ".gemtest".freeze, ".travis.yml".freeze, "CHANGELOG.rdoc".freeze, "Gemfile".freeze, "LICENSE".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "gemfiles/5.0.gemfile".freeze, "gemfiles/head.gemfile".freeze, "lib/generators/.document".freeze, "lib/generators/minitest.rb".freeze, "lib/generators/minitest/controller/controller_generator.rb".freeze, "lib/generators/minitest/controller/templates/controller_spec.rb".freeze, "lib/generators/minitest/controller/templates/controller_test.rb".freeze, "lib/generators/minitest/generator/generator_generator.rb".freeze, "lib/generators/minitest/generator/templates/generator_spec.rb".freeze, "lib/generators/minitest/generator/templates/generator_test.rb".freeze, "lib/generators/minitest/helper/helper_generator.rb".freeze, "lib/generators/minitest/install/install_generator.rb".freeze, "lib/generators/minitest/install/templates/test_helper.rb".freeze, "lib/generators/minitest/integration/integration_generator.rb".freeze, "lib/generators/minitest/integration/templates/integration_spec.rb".freeze, "lib/generators/minitest/integration/templates/integration_test.rb".freeze, "lib/generators/minitest/job/job_generator.rb".freeze, "lib/generators/minitest/job/templates/job_spec.rb".freeze, "lib/generators/minitest/job/templates/job_test.rb".freeze, "lib/generators/minitest/mailer/mailer_generator.rb".freeze, "lib/generators/minitest/mailer/templates/mailer_spec.rb".freeze, "lib/generators/minitest/mailer/templates/mailer_test.rb".freeze, "lib/generators/minitest/mailer/templates/preview.rb".freeze, "lib/generators/minitest/model/model_generator.rb".freeze, "lib/generators/minitest/model/templates/fixtures.yml".freeze, "lib/generators/minitest/model/templates/model_spec.rb".freeze, "lib/generators/minitest/model/templates/model_test.rb".freeze, "lib/generators/minitest/scaffold/scaffold_generator.rb".freeze, "lib/generators/minitest/scaffold/templates/api_controller_spec.rb".freeze, "lib/generators/minitest/scaffold/templates/api_controller_test.rb".freeze, "lib/generators/minitest/scaffold/templates/controller_spec.rb".freeze, "lib/generators/minitest/scaffold/templates/controller_test.rb".freeze, "lib/minitest-rails.rb".freeze, "lib/minitest/rails.rb".freeze, "lib/minitest/rails/assertions.rb".freeze, "lib/minitest/rails/constant_lookup.rb".freeze, "lib/minitest/rails/controller.rb".freeze, "lib/minitest/rails/expectations.rb".freeze, "lib/minitest/rails/railtie.rb".freeze, "lib/minitest/rails/version.rb".freeze, "minitest-rails.gemspec".freeze, "tasks/test.rake".freeze, "test/generators/test_controller_generator.rb".freeze, "test/generators/test_generator_generator.rb".freeze, "test/generators/test_helper_generator.rb".freeze, "test/generators/test_install_generator.rb".freeze, "test/generators/test_job_generator.rb".freeze, "test/generators/test_mailer_generator.rb".freeze, "test/generators/test_model_generator.rb".freeze, "test/generators/test_scaffold_generator.rb".freeze, "test/helper.rb".freeze, "test/rails/action_dispatch/test_assertions.rb".freeze, "test/rails/action_dispatch/test_expectations.rb".freeze, "test/rails/action_dispatch/test_spec_type.rb".freeze, "test/rails/action_mailer/test_mailers.rb".freeze, "test/rails/action_mailer/test_spec_type.rb".freeze, "test/rails/action_view/test_helpers.rb".freeze, "test/rails/action_view/test_spec_type.rb".freeze, "test/rails/active_job/test_assertions.rb".freeze, "test/rails/active_job/test_expectations.rb".freeze, "test/rails/active_job/test_spec_type.rb".freeze, "test/rails/active_support/test_assertions.rb".freeze, "test/rails/active_support/test_expectations.rb".freeze, "test/rails/active_support/test_spec_type.rb".freeze, "test/rails/generators/test_spec_type.rb".freeze, "test/rails/test_constant_lookup.rb".freeze, "test/test_sanity.rb".freeze]
|
16
16
|
s.homepage = "http://blowmage.com/minitest-rails".freeze
|
17
17
|
s.licenses = ["MIT".freeze]
|
18
18
|
s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
|
@@ -24,14 +24,14 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
26
|
s.add_runtime_dependency(%q<minitest>.freeze, ["~> 5.8"])
|
27
|
-
s.add_runtime_dependency(%q<railties>.freeze, ["~> 5.0
|
27
|
+
s.add_runtime_dependency(%q<railties>.freeze, ["~> 5.0"])
|
28
28
|
s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
29
29
|
s.add_development_dependency(%q<fakefs>.freeze, ["= 0.4.3"])
|
30
30
|
s.add_development_dependency(%q<minitest-focus>.freeze, ["~> 1.1"])
|
31
31
|
s.add_development_dependency(%q<hoe>.freeze, ["~> 3.15"])
|
32
32
|
else
|
33
33
|
s.add_dependency(%q<minitest>.freeze, ["~> 5.8"])
|
34
|
-
s.add_dependency(%q<railties>.freeze, ["~> 5.0
|
34
|
+
s.add_dependency(%q<railties>.freeze, ["~> 5.0"])
|
35
35
|
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
36
36
|
s.add_dependency(%q<fakefs>.freeze, ["= 0.4.3"])
|
37
37
|
s.add_dependency(%q<minitest-focus>.freeze, ["~> 1.1"])
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
end
|
40
40
|
else
|
41
41
|
s.add_dependency(%q<minitest>.freeze, ["~> 5.8"])
|
42
|
-
s.add_dependency(%q<railties>.freeze, ["~> 5.0
|
42
|
+
s.add_dependency(%q<railties>.freeze, ["~> 5.0"])
|
43
43
|
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
44
44
|
s.add_dependency(%q<fakefs>.freeze, ["= 0.4.3"])
|
45
45
|
s.add_dependency(%q<minitest-focus>.freeze, ["~> 1.1"])
|
data/tasks/test.rake
CHANGED
@@ -1,18 +1,24 @@
|
|
1
|
+
require "bundler"
|
2
|
+
|
1
3
|
namespace :test do
|
2
4
|
desc "Run tests for Rails 5.0"
|
3
5
|
task "5.0" do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
Bundler.with_clean_env do
|
7
|
+
sh "rm -f Gemfile.lock"
|
8
|
+
ENV["RAILS_VERSION"] = "5.0"
|
9
|
+
sh "bundle && bundle exec rake test"
|
10
|
+
sh "rm -f Gemfile.lock"
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
desc "Run tests for Rails head"
|
11
15
|
task "head" do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
Bundler.with_clean_env do
|
17
|
+
sh "rm -f Gemfile.lock"
|
18
|
+
ENV["RAILS_VERSION"] = "head"
|
19
|
+
sh "bundle && bundle exec rake test"
|
20
|
+
sh "rm -f Gemfile.lock"
|
21
|
+
end
|
16
22
|
end
|
17
23
|
|
18
24
|
desc "Run tests for all Rails versions"
|
@@ -5,7 +5,7 @@ class TestControllerGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_controller_generator
|
7
7
|
assert_output(/create test\/controllers\/user_controller_test.rb/m) do
|
8
|
-
Minitest::Generators::ControllerGenerator.start ["user"]
|
8
|
+
Minitest::Generators::ControllerGenerator.start ["user", "--no-spec"]
|
9
9
|
end
|
10
10
|
assert File.exists? "test/controllers/user_controller_test.rb"
|
11
11
|
contents = File.read "test/controllers/user_controller_test.rb"
|
@@ -14,7 +14,7 @@ class TestControllerGenerator < GeneratorTest
|
|
14
14
|
|
15
15
|
def test_namespaced_controller_generator
|
16
16
|
assert_output(/create test\/controllers\/admin\/user_controller_test.rb/m) do
|
17
|
-
Minitest::Generators::ControllerGenerator.start ["admin/user"]
|
17
|
+
Minitest::Generators::ControllerGenerator.start ["admin/user", "--no-spec"]
|
18
18
|
end
|
19
19
|
assert File.exists? "test/controllers/admin/user_controller_test.rb"
|
20
20
|
contents = File.read "test/controllers/admin/user_controller_test.rb"
|
@@ -26,7 +26,7 @@ class TestControllerGenerator < GeneratorTest
|
|
26
26
|
Rails::Generators.namespace = TestApp
|
27
27
|
|
28
28
|
assert_output(/create test\/controllers\/test_app\/user_controller_test.rb/m) do
|
29
|
-
Minitest::Generators::ControllerGenerator.start ["user"]
|
29
|
+
Minitest::Generators::ControllerGenerator.start ["user", "--no-spec"]
|
30
30
|
end
|
31
31
|
assert File.exists? "test/controllers/test_app/user_controller_test.rb"
|
32
32
|
contents = File.read "test/controllers/test_app/user_controller_test.rb"
|
@@ -39,7 +39,7 @@ class TestControllerGenerator < GeneratorTest
|
|
39
39
|
|
40
40
|
def test_controller_generator_spec
|
41
41
|
assert_output(/create test\/controllers\/user_controller_test.rb/m) do
|
42
|
-
Minitest::Generators::ControllerGenerator.start ["user"
|
42
|
+
Minitest::Generators::ControllerGenerator.start ["user"]
|
43
43
|
end
|
44
44
|
assert File.exists? "test/controllers/user_controller_test.rb"
|
45
45
|
contents = File.read "test/controllers/user_controller_test.rb"
|
@@ -48,7 +48,7 @@ class TestControllerGenerator < GeneratorTest
|
|
48
48
|
|
49
49
|
def test_namespaced_controller_generator_spec
|
50
50
|
assert_output(/create test\/controllers\/admin\/user_controller_test.rb/m) do
|
51
|
-
Minitest::Generators::ControllerGenerator.start ["admin/user"
|
51
|
+
Minitest::Generators::ControllerGenerator.start ["admin/user"]
|
52
52
|
end
|
53
53
|
assert File.exists? "test/controllers/admin/user_controller_test.rb"
|
54
54
|
contents = File.read "test/controllers/admin/user_controller_test.rb"
|
@@ -5,7 +5,7 @@ class TestGeneratorGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_generator_generator
|
7
7
|
assert_output(/create test\/lib\/generators\/awesome_generator_test.rb/m) do
|
8
|
-
Minitest::Generators::GeneratorGenerator.start ["awesome"]
|
8
|
+
Minitest::Generators::GeneratorGenerator.start ["awesome", "--no-spec"]
|
9
9
|
end
|
10
10
|
assert File.exists? "test/lib/generators/awesome_generator_test.rb"
|
11
11
|
contents = File.read "test/lib/generators/awesome_generator_test.rb"
|
@@ -14,7 +14,7 @@ class TestGeneratorGenerator < GeneratorTest
|
|
14
14
|
|
15
15
|
def test_namespaced_generator_generator
|
16
16
|
assert_output(/create test\/lib\/generators\/rails\/awesome_generator_test.rb/m) do
|
17
|
-
Minitest::Generators::GeneratorGenerator.start ["rails/awesome"]
|
17
|
+
Minitest::Generators::GeneratorGenerator.start ["rails/awesome", "--no-spec"]
|
18
18
|
end
|
19
19
|
assert File.exists? "test/lib/generators/rails/awesome_generator_test.rb"
|
20
20
|
contents = File.read "test/lib/generators/rails/awesome_generator_test.rb"
|
@@ -26,7 +26,7 @@ class TestGeneratorGenerator < GeneratorTest
|
|
26
26
|
Rails::Generators.namespace = TestApp
|
27
27
|
|
28
28
|
assert_output(/create test\/lib\/generators\/test_app\/awesome_generator_test.rb/m) do
|
29
|
-
Minitest::Generators::GeneratorGenerator.start ["awesome"]
|
29
|
+
Minitest::Generators::GeneratorGenerator.start ["awesome", "--no-spec"]
|
30
30
|
end
|
31
31
|
assert File.exists? "test/lib/generators/test_app/awesome_generator_test.rb"
|
32
32
|
contents = File.read "test/lib/generators/test_app/awesome_generator_test.rb"
|
@@ -39,7 +39,7 @@ class TestGeneratorGenerator < GeneratorTest
|
|
39
39
|
|
40
40
|
def test_generator_generator_spec
|
41
41
|
assert_output(/create test\/lib\/generators\/awesome_generator_test.rb/m) do
|
42
|
-
Minitest::Generators::GeneratorGenerator.start ["awesome"
|
42
|
+
Minitest::Generators::GeneratorGenerator.start ["awesome"]
|
43
43
|
end
|
44
44
|
assert File.exists? "test/lib/generators/awesome_generator_test.rb"
|
45
45
|
contents = File.read "test/lib/generators/awesome_generator_test.rb"
|
@@ -48,7 +48,7 @@ class TestGeneratorGenerator < GeneratorTest
|
|
48
48
|
|
49
49
|
def test_namespaced_generator_generator_spec
|
50
50
|
assert_output(/create test\/lib\/generators\/rails\/awesome_generator_test.rb/m) do
|
51
|
-
Minitest::Generators::GeneratorGenerator.start ["rails/awesome"
|
51
|
+
Minitest::Generators::GeneratorGenerator.start ["rails/awesome"]
|
52
52
|
end
|
53
53
|
assert File.exists? "test/lib/generators/rails/awesome_generator_test.rb"
|
54
54
|
contents = File.read "test/lib/generators/rails/awesome_generator_test.rb"
|
@@ -5,28 +5,28 @@ class TestHelperGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_helper_generator
|
7
7
|
refute_output(/create test\/helpers\/user_helper_test.rb/m) do
|
8
|
-
Minitest::Generators::HelperGenerator.start ["user"]
|
8
|
+
Minitest::Generators::HelperGenerator.start ["user", "--no-spec"]
|
9
9
|
end
|
10
10
|
refute File.exists? "test/helpers/user_helper_test.rb"
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_namespaced_helper_generator
|
14
14
|
refute_output(/create test\/helpers\/admin\/user_helper_test.rb/m) do
|
15
|
-
Minitest::Generators::HelperGenerator.start ["admin/user"]
|
15
|
+
Minitest::Generators::HelperGenerator.start ["admin/user", "--no-spec"]
|
16
16
|
end
|
17
17
|
refute File.exists? "test/helpers/admin/user_helper_test.rb"
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_helper_generator_spec
|
21
21
|
refute_output(/create test\/helpers\/user_helper_test.rb/m) do
|
22
|
-
Minitest::Generators::HelperGenerator.start ["user"
|
22
|
+
Minitest::Generators::HelperGenerator.start ["user"]
|
23
23
|
end
|
24
24
|
refute File.exists? "test/helpers/user_helper_test.rb"
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_namespaced_helper_generator_spec
|
28
28
|
refute_output(/create test\/helpers\/admin\/user_helper_test.rb/m) do
|
29
|
-
Minitest::Generators::HelperGenerator.start ["admin/user"
|
29
|
+
Minitest::Generators::HelperGenerator.start ["admin/user"]
|
30
30
|
end
|
31
31
|
refute File.exists? "test/helpers/admin/user_helper_test.rb"
|
32
32
|
end
|
@@ -7,7 +7,7 @@ if defined? ActiveJob # Rails 4.2 and later.
|
|
7
7
|
|
8
8
|
def test_job_generator
|
9
9
|
assert_output(/create test\/jobs\/user_invite_job_test.rb/m) do
|
10
|
-
Minitest::Generators::JobGenerator.start ["user_invite"]
|
10
|
+
Minitest::Generators::JobGenerator.start ["user_invite", "--no-spec"]
|
11
11
|
end
|
12
12
|
assert File.exists? "test/jobs/user_invite_job_test.rb"
|
13
13
|
contents = File.read "test/jobs/user_invite_job_test.rb"
|
@@ -16,7 +16,7 @@ if defined? ActiveJob # Rails 4.2 and later.
|
|
16
16
|
|
17
17
|
def test_namespaced_job_generator
|
18
18
|
assert_output(/create test\/jobs\/admin\/user_invite_job_test.rb/m) do
|
19
|
-
Minitest::Generators::JobGenerator.start ["admin/user_invite"]
|
19
|
+
Minitest::Generators::JobGenerator.start ["admin/user_invite", "--no-spec"]
|
20
20
|
end
|
21
21
|
assert File.exists? "test/jobs/admin/user_invite_job_test.rb"
|
22
22
|
contents = File.read "test/jobs/admin/user_invite_job_test.rb"
|
@@ -25,7 +25,7 @@ if defined? ActiveJob # Rails 4.2 and later.
|
|
25
25
|
|
26
26
|
def test_job_generator_spec
|
27
27
|
assert_output(/create test\/jobs\/user_invite_job_test.rb/m) do
|
28
|
-
Minitest::Generators::JobGenerator.start ["user_invite"
|
28
|
+
Minitest::Generators::JobGenerator.start ["user_invite"]
|
29
29
|
end
|
30
30
|
assert File.exists? "test/jobs/user_invite_job_test.rb"
|
31
31
|
contents = File.read "test/jobs/user_invite_job_test.rb"
|
@@ -34,7 +34,7 @@ if defined? ActiveJob # Rails 4.2 and later.
|
|
34
34
|
|
35
35
|
def test_namespaced_job_generator_spec
|
36
36
|
assert_output(/create test\/jobs\/admin\/user_invite_job_test.rb/m) do
|
37
|
-
Minitest::Generators::JobGenerator.start ["admin/user_invite"
|
37
|
+
Minitest::Generators::JobGenerator.start ["admin/user_invite"]
|
38
38
|
end
|
39
39
|
assert File.exists? "test/jobs/admin/user_invite_job_test.rb"
|
40
40
|
contents = File.read "test/jobs/admin/user_invite_job_test.rb"
|
@@ -5,7 +5,7 @@ class TestMailerGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_mailer_generator
|
7
7
|
assert_output(/create test\/mailers\/notification_mailer_test.rb/m) do
|
8
|
-
Minitest::Generators::MailerGenerator.start ["notification"]
|
8
|
+
Minitest::Generators::MailerGenerator.start ["notification", "--no-spec"]
|
9
9
|
end
|
10
10
|
assert File.exists? "test/mailers/notification_mailer_test.rb"
|
11
11
|
contents = File.read "test/mailers/notification_mailer_test.rb"
|
@@ -14,7 +14,7 @@ class TestMailerGenerator < GeneratorTest
|
|
14
14
|
|
15
15
|
def test_namespaced_mailer_generator
|
16
16
|
assert_output(/create test\/mailers\/admin\/notification_mailer_test.rb/m) do
|
17
|
-
Minitest::Generators::MailerGenerator.start ["admin/notification"]
|
17
|
+
Minitest::Generators::MailerGenerator.start ["admin/notification", "--no-spec"]
|
18
18
|
end
|
19
19
|
assert File.exists? "test/mailers/admin/notification_mailer_test.rb"
|
20
20
|
contents = File.read "test/mailers/admin/notification_mailer_test.rb"
|
@@ -23,7 +23,7 @@ class TestMailerGenerator < GeneratorTest
|
|
23
23
|
|
24
24
|
def test_mailer_generator_spec
|
25
25
|
assert_output(/create test\/mailers\/notification_mailer_test.rb/m) do
|
26
|
-
Minitest::Generators::MailerGenerator.start ["notification", "welcome"
|
26
|
+
Minitest::Generators::MailerGenerator.start ["notification", "welcome"]
|
27
27
|
end
|
28
28
|
assert File.exists? "test/mailers/notification_mailer_test.rb"
|
29
29
|
contents = File.read "test/mailers/notification_mailer_test.rb"
|
@@ -32,7 +32,7 @@ class TestMailerGenerator < GeneratorTest
|
|
32
32
|
|
33
33
|
def test_namespaced_mailer_generator_spec
|
34
34
|
assert_output(/create test\/mailers\/admin\/notification_mailer_test.rb/m) do
|
35
|
-
Minitest::Generators::MailerGenerator.start ["admin/notification", "welcome"
|
35
|
+
Minitest::Generators::MailerGenerator.start ["admin/notification", "welcome"]
|
36
36
|
end
|
37
37
|
assert File.exists? "test/mailers/admin/notification_mailer_test.rb"
|
38
38
|
contents = File.read "test/mailers/admin/notification_mailer_test.rb"
|
@@ -5,7 +5,7 @@ class TestModelGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_model_generator
|
7
7
|
assert_output(/create test\/models\/user_test.rb/m) do
|
8
|
-
Minitest::Generators::ModelGenerator.start ["user"]
|
8
|
+
Minitest::Generators::ModelGenerator.start ["user", "--no-spec"]
|
9
9
|
end
|
10
10
|
assert File.exists? "test/models/user_test.rb"
|
11
11
|
contents = File.read "test/models/user_test.rb"
|
@@ -14,7 +14,7 @@ class TestModelGenerator < GeneratorTest
|
|
14
14
|
|
15
15
|
def test_namespaced_model_generator
|
16
16
|
assert_output(/create test\/models\/admin\/user_test.rb/m) do
|
17
|
-
Minitest::Generators::ModelGenerator.start ["admin/user"]
|
17
|
+
Minitest::Generators::ModelGenerator.start ["admin/user", "--no-spec"]
|
18
18
|
end
|
19
19
|
assert File.exists? "test/models/admin/user_test.rb"
|
20
20
|
contents = File.read "test/models/admin/user_test.rb"
|
@@ -26,7 +26,7 @@ class TestModelGenerator < GeneratorTest
|
|
26
26
|
Rails::Generators.namespace = TestApp
|
27
27
|
|
28
28
|
assert_output(/create test\/models\/test_app\/user_test.rb/m) do
|
29
|
-
Minitest::Generators::ModelGenerator.start ["user"]
|
29
|
+
Minitest::Generators::ModelGenerator.start ["user", "--no-spec"]
|
30
30
|
end
|
31
31
|
assert File.exists? "test/models/test_app/user_test.rb"
|
32
32
|
contents = File.read "test/models/test_app/user_test.rb"
|
@@ -39,7 +39,7 @@ class TestModelGenerator < GeneratorTest
|
|
39
39
|
|
40
40
|
def test_model_generator_spec
|
41
41
|
assert_output(/create test\/models\/user_test.rb/m) do
|
42
|
-
Minitest::Generators::ModelGenerator.start ["user"
|
42
|
+
Minitest::Generators::ModelGenerator.start ["user"]
|
43
43
|
end
|
44
44
|
assert File.exists? "test/models/user_test.rb"
|
45
45
|
# assert File.exists? "test/fixtures/users.yml"
|
@@ -49,7 +49,7 @@ class TestModelGenerator < GeneratorTest
|
|
49
49
|
|
50
50
|
def test_namespaced_model_generator_spec
|
51
51
|
assert_output(/create test\/models\/admin\/user_test.rb/m) do
|
52
|
-
Minitest::Generators::ModelGenerator.start ["admin/user"
|
52
|
+
Minitest::Generators::ModelGenerator.start ["admin/user"]
|
53
53
|
end
|
54
54
|
assert File.exists? "test/models/admin/user_test.rb"
|
55
55
|
contents = File.read "test/models/admin/user_test.rb"
|
@@ -58,14 +58,14 @@ class TestModelGenerator < GeneratorTest
|
|
58
58
|
|
59
59
|
def test_model_generator_fixture
|
60
60
|
assert_output(/create test\/fixtures\/users.yml/m) do
|
61
|
-
Minitest::Generators::ModelGenerator.start ["user"]
|
61
|
+
Minitest::Generators::ModelGenerator.start ["user", "--no-spec"]
|
62
62
|
end
|
63
63
|
assert File.exists? "test/fixtures/users.yml"
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_namespaced_model_generator_fixture
|
67
67
|
assert_output(/create test\/fixtures\/admin\/users.yml/m) do
|
68
|
-
Minitest::Generators::ModelGenerator.start ["admin/user"]
|
68
|
+
Minitest::Generators::ModelGenerator.start ["admin/user", "--no-spec"]
|
69
69
|
end
|
70
70
|
assert File.exists? "test/fixtures/admin/users.yml"
|
71
71
|
end
|
@@ -5,7 +5,7 @@ class TestScaffoldGenerator < GeneratorTest
|
|
5
5
|
|
6
6
|
def test_scaffold_generator
|
7
7
|
assert_output(/create test\/controllers\/users_controller_test.rb/m) do
|
8
|
-
Minitest::Generators::ScaffoldGenerator.start ["User", "name:string", "email:string"]
|
8
|
+
Minitest::Generators::ScaffoldGenerator.start ["User", "name:string", "email:string", "--no-spec"]
|
9
9
|
end
|
10
10
|
assert File.exists? "test/controllers/users_controller_test.rb"
|
11
11
|
contents = File.read "test/controllers/users_controller_test.rb"
|
@@ -15,7 +15,7 @@ class TestScaffoldGenerator < GeneratorTest
|
|
15
15
|
|
16
16
|
def test_scaffold_generator_spec
|
17
17
|
assert_output(/create test\/controllers\/users_controller_test.rb/m) do
|
18
|
-
Minitest::Generators::ScaffoldGenerator.start ["User", "name:string", "email:string"
|
18
|
+
Minitest::Generators::ScaffoldGenerator.start ["User", "name:string", "email:string"]
|
19
19
|
end
|
20
20
|
assert File.exists? "test/controllers/users_controller_test.rb"
|
21
21
|
contents = File.read "test/controllers/users_controller_test.rb"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.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: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.0
|
33
|
+
version: '5.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
|
-
version: 5.0
|
40
|
+
version: '5.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/minitest/rails.rb
|
150
150
|
- lib/minitest/rails/assertions.rb
|
151
151
|
- lib/minitest/rails/constant_lookup.rb
|
152
|
+
- lib/minitest/rails/controller.rb
|
152
153
|
- lib/minitest/rails/expectations.rb
|
153
154
|
- lib/minitest/rails/railtie.rb
|
154
155
|
- lib/minitest/rails/version.rb
|
@@ -196,9 +197,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
197
|
version: '0'
|
197
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
199
|
requirements:
|
199
|
-
- - "
|
200
|
+
- - ">="
|
200
201
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
202
|
+
version: '0'
|
202
203
|
requirements: []
|
203
204
|
rubyforge_project:
|
204
205
|
rubygems_version: 2.6.4
|