test/unit/server_tests.rb in sanford-0.8.0 vs test/unit/server_tests.rb in sanford-0.9.0

- old
+ new

@@ -1,32 +1,34 @@ require 'assert' require 'sanford/server' +require 'test/support/services' + class Sanford::Server - class BaseTests < Assert::Context + class UnitTests < Assert::Context desc "Sanford::Server" setup do - @server = Sanford::Server.new(TestHost, { :keep_alive => true }) + @server = Sanford::Server.new(TestHost, :keep_alive => true) end subject{ @server } - should have_instance_methods :sanford_host, :sanford_host_data, :sanford_host_options - should have_instance_methods :on_run + should have_readers :sanford_host, :sanford_host_data, :sanford_host_options + should have_imeths :on_run should "include DatTCP::Server" do - assert_includes DatTCP::Server, subject.class.included_modules + assert_includes DatTCP::Server, subject.class end should "save it's host and host options but not initialize a host data yet" do assert_equal TestHost, subject.sanford_host assert_equal true, subject.sanford_host_options[:receives_keep_alive] assert_nil subject.sanford_host_data end end - class RunTests < BaseTests + class RunTests < UnitTests desc "run" setup do @server.listen(TestHost.ip, TestHost.port) @server.run end