Skip to content

Commit

Permalink
Add a test case that fails #14
Browse files Browse the repository at this point in the history
  * Ruby 2.1.3 or older
  * mail gem
  * Max OS X
  • Loading branch information
yuki24 committed Nov 8, 2014
1 parent 9ef4baa commit 44c451f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions did_you_mean.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake"
spec.add_development_dependency "rake-compiler"
spec.add_development_dependency "minitest"
spec.add_development_dependency "mail"
end
4 changes: 4 additions & 0 deletions lib/did_you_mean/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ def assert_suggestion(array, expected)
def assert_suggestions(array, *expected)
expected.each {|s| assert_suggestion(array, s) }
end

def assert_nothing_raised
yield
end
end
end
6 changes: 6 additions & 0 deletions test/no_method_error_extension_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ def setup
def test_receiver
assert_same @receiver, @error.args.first
end

def test_extension_doesnt_break_ruby
assert_nothing_raised do
File.open('tmp/foo.txt', 'w'){|f| Array(Mail.new) }
end
end
end
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'minitest/autorun'
require 'minitest/unit'
require 'did_you_mean'
require 'mail'

begin
MiniTest::Test
Expand Down

0 comments on commit 44c451f

Please sign in to comment.