This website requires JavaScript.
Explore
Help
Sign in
kotovalexarian-likes-github
/
rails--rails
Watch
1
Star
0
Fork
You've already forked rails--rails
0
mirror of
https://github.com/rails/rails.git
synced
2022-11-09 12:12:34 -05:00
Code
Releases
Activity
f8a798c8e6
rails--rails
/
activesupport
/
lib
/
active_support
/
testing
/
autorun.rb
8 lines
84 B
Ruby
Raw
Normal View
History
Unescape
Escape
Use frozen-string-literal in ActiveSupport
2017-07-09 08:06:36 -04:00
# frozen_string_literal: true
[Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`
2017-07-10 09:39:13 -04:00
applies new string literal convention in activesupport/lib The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
2016-08-06 11:58:50 -04:00
gem
"
minitest
"
Add active_support/testing/autorun minitest/autorun load minitest/spec polluting the global namespace with the DSL that we don't want on Rails
2012-12-28 14:17:37 -05:00
applies new string literal convention in activesupport/lib The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
2016-08-06 11:58:50 -04:00
require
"
minitest
"
Add active_support/testing/autorun minitest/autorun load minitest/spec polluting the global namespace with the DSL that we don't want on Rails
2012-12-28 14:17:37 -05:00
Revise setting of run_with_rails_extension. The Rails test runner supports three ways to run tests: directly, via rake, or ruby. When Running with Ruby ala `ruby -Itest test/models/post_test.rb` our test file would be evaluated first, requiring `test_helper` and then `active_support/testing/autorun` that would then require the test file (which it hadn't been before) thus reevaluating it. This caused exceptions if using Active Support's declarative syntax. Fix this by shifting around when we set the how we're run to closer mimick the require order. If we're running with `bin/rails test` the test command file is run first and we then set `run_with_rails_extension`, later we hit `active_support/testing/autorun` and do nothing — because we've been run elsewhere. If we at this point haven't set `run_with_rails_extension` we've been running with `ruby` this whole time and thus we set that. We should always trigger `Minitest.autorun` as it doesn't hurt to call it twice. Consolidate the two methods into a single one that better brings out the intent of why they're there.
2016-09-25 14:21:30 -04:00
Minitest
.
autorun
Copy permalink