-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1067 from bf4/fix_warnings
Fix warnings
- Loading branch information
Showing
20 changed files
with
162 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class Foo < Rails::Application | ||
if Rails::VERSION::MAJOR >= 4 | ||
config.eager_load = false | ||
config.secret_key_base = 'abc123' | ||
config.action_controller.perform_caching = true | ||
config.active_support.test_order = :random | ||
config.logger = Logger.new(nil) | ||
ActionController::Base.cache_store = :memory_store | ||
end | ||
end | ||
Foo.initialize! | ||
|
||
module TestHelper | ||
Routes = ActionDispatch::Routing::RouteSet.new | ||
Routes.draw do | ||
get ':controller(/:action(/:id))' | ||
get ':controller(/:action)' | ||
end | ||
|
||
ActionController::Base.send :include, Routes.url_helpers | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Use cleaner stream testing interface from Rails 5 if available | ||
# see https://github.com/rails/rails/blob/29959eb59d/activesupport/lib/active_support/testing/stream.rb | ||
begin | ||
require "active_support/testing/stream" | ||
rescue LoadError | ||
module ActiveSupport | ||
module Testing | ||
module Stream #:nodoc: | ||
private | ||
|
||
def silence_stream(stream) | ||
old_stream = stream.dup | ||
stream.reopen(IO::NULL) | ||
stream.sync = true | ||
yield | ||
ensure | ||
stream.reopen(old_stream) | ||
old_stream.close | ||
end | ||
|
||
def quietly | ||
silence_stream(STDOUT) do | ||
silence_stream(STDERR) do | ||
yield | ||
end | ||
end | ||
end | ||
|
||
def capture(stream) | ||
stream = stream.to_s | ||
captured_stream = Tempfile.new(stream) | ||
stream_io = eval("$#{stream}") | ||
origin_stream = stream_io.dup | ||
stream_io.reopen(captured_stream) | ||
|
||
yield | ||
|
||
stream_io.rewind | ||
return captured_stream.read | ||
ensure | ||
captured_stream.close | ||
captured_stream.unlink | ||
stream_io.reopen(origin_stream) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActionController::TestCase.class_eval do | ||
def setup | ||
@routes = TestHelper::Routes | ||
end | ||
end |
Oops, something went wrong.