[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>
I'll try to be brief so we can discuss all this. tl;dr: RubySpec is
19 messages
2015/01/05
[#67353] Re: Future of test suites for Ruby
— Tanaka Akira <akr@...>
2015/01/05
2015-01-06 7:18 GMT+09:00 Charles Oliver Nutter <headius@headius.com>:
[#67444] [ruby-trunk - Feature #10718] [Open] IO#close should not raise IOError on closed IO objects. — akr@...
Issue #10718 has been reported by Akira Tanaka.
3 messages
2015/01/09
[#67689] Keyword Arguments — Anthony Crumley <anthony.crumley@...>
Please forgive my ignorance as I am new to MRI development and am still
5 messages
2015/01/20
[#67733] [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5 — normalperson@...
Issue #10761 has been updated by Eric Wong.
4 messages
2015/01/21
[#67736] Re: [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5
— Eric Wong <normalperson@...>
2015/01/22
normalperson@yhbt.net wrote:
[#67772] Preventing Redundant Email Messages — Jeremy Evans <code@...>
For a long time, I've wondered why I sometimes receive redundant email
5 messages
2015/01/23
[ruby-core:67536] [ruby-trunk - Misc #10721] Failing test because of DNS server
From:
nobu@...
Date:
2015-01-12 10:13:49 UTC
List:
ruby-core #67536
Issue #10721 has been updated by Nobuyoshi Nakada.
You can use `assert_raise_with_message`.
~~~diff
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 4d82fd7..4f5093d 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -1,5 +1,6 @@
# coding: US-ASCII
require 'test/unit'
+require 'minitest/mock'
require 'net/http'
require 'stringio'
require_relative 'utils'
@@ -189,11 +190,12 @@ class TestNetHTTP < Test::Unit::TestCase
end
def test_failure_message_includes_failed_domain_and_port
- begin
- Net::HTTP.get(URI.parse("http://doesnotexist.bogus"))
- fail "should have raised"
- rescue => e
- assert_includes e.message, "doesnotexist.bogus:80"
+ uri = URI.parse("http://doesnotexist.bogus")
+ assert_raise_with_message(RuntimeError, /doesnotexist.bogus:80/) do
+ failure_message = "SocketError: getaddrinfo: Name or service not known"
+ TCPSocket.stub :open, proc {raise failure_message} do
+ Net::HTTP.get(uri)
+ end
end
end
~~~
----------------------------------------
Misc #10721: Failing test because of DNS server
https://bugs.ruby-lang.org/issues/10721#change-50950
* Author: Anthony Crumley
* Status: Assigned
* Priority: Normal
* Assignee: Eric Wong
----------------------------------------
The following test is failing:
[ 5/52] TestNetHTTP#test_failure_message_includes_failed_domain_and_port = 0.32 s
1) Failure:
TestNetHTTP#test_failure_message_includes_failed_domain_and_port [/vagrant/test/net/http/test_http.rb:196]:
Expected "should have raised" to include "doesnotexist.bogus:80".
The problem is caused by my ISP, Charter Cable, returning a search results page instead of a failed DNS lookup for http://doesnotexist.bogus. If I change my DNS server setting on my computer to use Google DNS then the test passes.
The attached patch uses a MiniTest stub to produce the DNS failure which results in the expected error message regardless of how the machine's DNS server responds to http://doesnotexist.bogus.
Thanks for everything you all do,
Anthony
---Files--------------------------------
dns_lookup.patch (1.06 KB)
dns_lookup_v2.patch (1.18 KB)
--
https://bugs.ruby-lang.org/