test/unit/response_tests.rb in sanford-protocol-0.6.0 vs test/unit/response_tests.rb in sanford-protocol-0.7.0
- old
+ new
@@ -1,19 +1,19 @@
require 'assert'
require 'sanford-protocol/response'
class Sanford::Protocol::Response
- class BaseTests < Assert::Context
+ class UnitTests < Assert::Context
desc "Sanford::Protocol::Response"
setup do
@response = Sanford::Protocol::Response.new([ 672, 'YAR!' ], { 'something' => true })
end
subject{ @response }
- should have_instance_methods :status, :code, :data, :to_hash, :to_s
- should have_class_methods :parse
+ should have_imeths :status, :code, :data, :to_hash, :to_s
+ should have_cmeths :parse
should "return its status#code with #code" do
assert_equal subject.status.code, subject.code
end
@@ -47,11 +47,11 @@
end
# Somewhat of a system test, want to make sure if Response is passed some
# "fuzzy" args that it will build it's status object as expected
- class StatusBuildingTests < BaseTests
+ class StatusBuildingTests < UnitTests
should "build a status with it's code set, given an integer" do
response = Sanford::Protocol::Response.new(574)
assert_equal 574, response.status.code
@@ -73,11 +73,11 @@
end
should "build a status with a code and message set, when given both" do
response = Sanford::Protocol::Response.new([ 348, "my message" ])
- assert_equal 348, response.status.code
- assert_equal "my message", response.status.message
+ assert_equal 348, response.status.code
+ assert_equal "my message", response.status.message
end
end
end