Skip to content

Commit

Permalink
Merge branch 'master' into fix-deprecation-warning-for-capture
Browse files Browse the repository at this point in the history
  • Loading branch information
vandrijevik committed May 27, 2015
2 parents 0cde8b2 + 2aeeb00 commit 11971fe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/foreigner/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def load!
if registered.key?(configured_name)
require registered[configured_name]
else
p "Database adapter #{configured_name} not supported. Use:\n" +
"Foreigner::Adapter.register '#{configured_name}', 'path/to/adapter'"
puts "Database adapter #{configured_name} not supported. Use:\n" +
"Foreigner::Adapter.register '#{configured_name}', 'path/to/adapter'"
end
end

Expand Down
9 changes: 9 additions & 0 deletions test/foreigner/adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ class Foreigner::AdapterTest < Foreigner::UnitTest

Foreigner::Adapter.load!
end

test "load prints warning message for an unsupported adapter on two lines" do
Foreigner::Adapter.stubs(:configured_name).returns('unsupported')

output = StringIO.new
with_stdout(output) { Foreigner::Adapter.load! }

assert_equal 2, output.string.split("\n").length
end
end
4 changes: 4 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def execute(sql, name = nil)
end
end

if ActiveSupport::TestCase.respond_to?(:test_order=)
ActiveSupport::TestCase.test_order = :random
end

module Foreigner
class UnitTest < ActiveSupport::TestCase
private
Expand Down

0 comments on commit 11971fe

Please sign in to comment.