spec/spec_helper.rb in async-io-0.5.0 vs spec/spec_helper.rb in async-io-1.0.0
- old
+ new
@@ -17,9 +17,24 @@
end
require "bundler/setup"
require "async/io"
+# This is useful for specs, but I hesitate to monkey patch a core class in the library itself.
+class Addrinfo
+ def == other
+ self.to_s == other.to_s
+ end
+
+ def != other
+ self.to_s != other.to_s
+ end
+
+ def <=> other
+ self.to_s <=> other.to_s
+ end
+end
+
# Shared rspec helpers:
require "async/rspec"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure