Skip to content

Commit

Permalink
Update dependency on async-dns and use async-rspec for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 25, 2017
1 parent ff7ee2d commit 93f04d7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
3 changes: 2 additions & 1 deletion rubydns.gemspec
Expand Up @@ -30,7 +30,8 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.2.6'

spec.add_dependency("async-dns", "~> 0.10")
spec.add_dependency("async-dns", "~> 0.12")
spec.add_development_dependency("async-rspec", "~> 1.0")

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rspec", "~> 3.4"
Expand Down
4 changes: 2 additions & 2 deletions spec/rubydns/daemon_spec.rb
Expand Up @@ -48,7 +48,7 @@ def startup
end

match(/peername/, IN::A) do |transaction|
transaction.respond!(transaction[:peer])
transaction.respond!(transaction[:remote_address].ip_address)
end

# Default DNS handler
Expand All @@ -65,7 +65,7 @@ def shutdown
end

describe "RubyDNS Daemonized Server" do
include_context "reactor"
include_context Async::RSpec::Reactor

before(:all) do
# BasicTestServer.controller output: $stderr
Expand Down
2 changes: 1 addition & 1 deletion spec/rubydns/injected_supervisor_spec.rb
Expand Up @@ -34,7 +34,7 @@ def test_message
IN = Resolv::DNS::Resource::IN

describe "RubyDNS::run_server(server_class: ...)" do
include_context "reactor"
include_context Async::RSpec::Reactor

let(:server) do
# Start the RubyDNS server
Expand Down
2 changes: 1 addition & 1 deletion spec/rubydns/passthrough_spec.rb
Expand Up @@ -28,7 +28,7 @@ module RubyDNS::PassthroughSpec
IN = Resolv::DNS::Resource::IN

describe "RubyDNS Passthrough Server" do
include_context "reactor"
include_context Async::RSpec::Reactor

def run_server
task = RubyDNS::run_server(:listen => SERVER_PORTS) do
Expand Down
15 changes: 1 addition & 14 deletions spec/spec_helper.rb
Expand Up @@ -18,20 +18,7 @@

require "bundler/setup"
require "async"
require "async/tcp_socket"
require "async/udp_socket"

RSpec.shared_context "reactor" do
let(:reactor) {Async::Reactor.new}

around(:each) do |example|
reactor.run do
example.run
end

reactor.close
end
end
require "async/rspec"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
Expand Down

0 comments on commit 93f04d7

Please sign in to comment.