mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use "minitest" consistently
The name of the minitest library is spelled that way: regular font, and lowercase. Lowercase is used even at the beginning of sentences, see http://docs.seattlerb.org/minitest/ I double-checked this with @zenspider too (thanks!).
This commit is contained in:
parent
e9ae7a1514
commit
f589e20b0a
17 changed files with 19 additions and 21 deletions
|
@ -18,8 +18,7 @@ require "active_job"
|
|||
ActiveJob::Base.queue_adapter = :test
|
||||
ActiveJob::Base.logger = ActiveSupport::Logger.new(nil)
|
||||
|
||||
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
||||
# to be shown.
|
||||
# Filter out the backtrace from minitest while preserving the one from other libraries.
|
||||
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
||||
|
||||
require "yaml"
|
||||
|
|
|
@ -65,8 +65,8 @@ module ActiveSupport
|
|||
#
|
||||
# parallelize(workers: 2, with: :threads)
|
||||
#
|
||||
# The threaded parallelization uses Minitest's parallel executor directly.
|
||||
# The processes parallelization uses a Ruby Drb server.
|
||||
# The threaded parallelization uses minitest's parallel executor directly.
|
||||
# The processes parallelization uses a Ruby DRb server.
|
||||
def parallelize(workers: 2, with: :processes)
|
||||
workers = ENV["PARALLEL_WORKERS"].to_i if ENV["PARALLEL_WORKERS"]
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ end
|
|||
|
||||
require "minitest/autorun"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
class BugTest < Minitest::Test
|
||||
|
|
|
@ -19,7 +19,7 @@ end
|
|||
require "minitest/autorun"
|
||||
require "active_job"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
class BuggyJob < ActiveJob::Base
|
||||
|
|
|
@ -18,7 +18,7 @@ end
|
|||
require "active_job"
|
||||
require "minitest/autorun"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
class BuggyJob < ActiveJob::Base
|
||||
|
|
|
@ -21,7 +21,7 @@ require "active_record"
|
|||
require "minitest/autorun"
|
||||
require "logger"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
# This connection will do for database-independent bug reports.
|
||||
|
|
|
@ -21,7 +21,7 @@ require "active_record"
|
|||
require "minitest/autorun"
|
||||
require "logger"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
# This connection will do for database-independent bug reports.
|
||||
|
|
|
@ -20,7 +20,7 @@ require "active_record"
|
|||
require "minitest/autorun"
|
||||
require "logger"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
# This connection will do for database-independent bug reports.
|
||||
|
|
|
@ -20,7 +20,7 @@ require "active_support"
|
|||
require "active_support/core_ext/object/blank"
|
||||
require "minitest/autorun"
|
||||
|
||||
# Ensure backward compatibility with Minitest 4
|
||||
# Ensure backward compatibility with minitest 4.
|
||||
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
class BugTest < Minitest::Test
|
||||
|
|
|
@ -196,7 +196,7 @@ Please refer to the [Changelog](https://github.com/rails/rails/blob/4-0-stable/a
|
|||
|
||||
### Deprecations
|
||||
|
||||
* Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from MiniTest instead.
|
||||
* Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from minitest instead.
|
||||
|
||||
* `ActiveSupport::Benchmarkable#silence` has been deprecated due to its lack of thread safety. It will be removed without replacement in Rails 4.1.
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ It includes some of these notable advancements:
|
|||
instead of waiting for the suite to complete.
|
||||
- Defer test output until the end of a full test run using the `-d` option.
|
||||
- Complete exception backtrace output using `-b` option.
|
||||
- Integration with `Minitest` to allow options like `-s` for test seed data,
|
||||
- Integration with minitest to allow options like `-s` for test seed data,
|
||||
`-n` for running specific test by name, `-v` for better verbose output and so forth.
|
||||
- Colored test output.
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ Documentation has to be concise but comprehensive. Explore and document edge cas
|
|||
|
||||
The proper names of Rails components have a space in between the words, like "Active Support". `ActiveRecord` is a Ruby module, whereas Active Record is an ORM. All Rails documentation should consistently refer to Rails components by their proper name, and if in your next blog post or presentation you remember this tidbit and take it into account that'd be phenomenal.
|
||||
|
||||
Spell names correctly: Arel, Test::Unit, RSpec, HTML, MySQL, JavaScript, ERB. When in doubt, please have a look at some authoritative source like their official documentation.
|
||||
Spell names correctly: Arel, minitest, RSpec, HTML, MySQL, JavaScript, ERB. When in doubt, please have a look at some authoritative source like their official documentation.
|
||||
|
||||
Use the article "an" for "SQL", as in "an SQL statement". Also "an SQLite database".
|
||||
|
||||
|
|
|
@ -546,7 +546,7 @@ vendor/tools.rb:
|
|||
|
||||
INFO: A good description of unit testing in Rails is given in [A Guide to Testing Rails Applications](testing.html)
|
||||
|
||||
Rails comes with a test suite called Minitest. Rails owes its stability to the use of tests. The commands available in the `test:` namespace helps in running the different tests you will hopefully write.
|
||||
Rails comes with a test framework called minitest. Rails owes its stability to the use of tests. The commands available in the `test:` namespace helps in running the different tests you will hopefully write.
|
||||
|
||||
### `rails tmp:`
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ The full set of methods that can be used in this block are as follows:
|
|||
* `stylesheets` turns on the hook for stylesheets in generators. Used in Rails for when the `scaffold` generator is run, but this hook can be used in other generates as well. Defaults to `true`.
|
||||
* `stylesheet_engine` configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to `:css`.
|
||||
* `scaffold_stylesheet` creates `scaffold.css` when generating a scaffolded resource. Defaults to `true`.
|
||||
* `test_framework` defines which test framework to use. Defaults to `false` and will use Minitest by default.
|
||||
* `test_framework` defines which test framework to use. Defaults to `false` and will use minitest by default.
|
||||
* `template_engine` defines which template engine to use, such as ERB or Haml. Defaults to `:erb`.
|
||||
|
||||
### Configuring Middleware
|
||||
|
|
|
@ -10,8 +10,7 @@ ActiveRecord::Migrator.migrations_paths << File.expand_path('../db/migrate', __d
|
|||
<% end -%>
|
||||
require "rails/test_help"
|
||||
|
||||
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
||||
# to be shown.
|
||||
# Filter out the backtrace from minitest while preserving the one from other libraries.
|
||||
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
||||
|
||||
<% unless engine? -%>
|
||||
|
|
|
@ -87,7 +87,7 @@ module Rails
|
|||
@filters = [ @named_filter, *derive_line_filters(patterns) ].compact
|
||||
end
|
||||
|
||||
# Minitest uses === to find matching filters.
|
||||
# minitest uses === to find matching filters.
|
||||
def ===(method)
|
||||
@filters.any? { |filter| filter === method }
|
||||
end
|
||||
|
@ -96,7 +96,7 @@ module Rails
|
|||
def derive_named_filter(filter)
|
||||
if filter.respond_to?(:named_filter)
|
||||
filter.named_filter
|
||||
elsif filter =~ %r%/(.*)/% # Regexp filtering copied from Minitest.
|
||||
elsif filter =~ %r%/(.*)/% # Regexp filtering copied from minitest.
|
||||
Regexp.new $1
|
||||
elsif filter.is_a?(String)
|
||||
filter
|
||||
|
|
|
@ -26,7 +26,7 @@ class CodeStatisticsCalculatorTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
test "count number of methods in Minitest file" do
|
||||
test "count number of methods in minitest file" do
|
||||
code = <<-RUBY
|
||||
class FooTest < ActionController::TestCase
|
||||
test 'expectation' do
|
||||
|
|
Loading…
Reference in a new issue