fail("Request was not accepted")ifpub.response_header.status!=200
block.callunlessblock.nil?
}
pub.errback{|error|fail("Erro inexperado na execucao do teste: #{error.last_effective_url.nil??"":error.last_effective_url.request_uri}#{error.response}")}
@@ -14,7 +14,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("No channel id provided.",pub.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(pub)
}
end
...
...
@@ -31,7 +30,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(0,pub_1.response_header.content_length,"Recieved a non empty response")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
EventMachine.run{
...
...
@@ -43,7 +41,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(channel_2,response["channel"].to_s,"Channel was not recognized")
EventMachine.stop
}
fail_if_connecttion_error(pub_2)
}
end
...
...
@@ -62,7 +59,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(channel,response["channel"].to_s,"Channel was not recognized")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
EventMachine.run{
...
...
@@ -74,7 +70,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(channel,response["channel"].to_s,"Channel was not recognized")
EventMachine.stop
}
fail_if_connecttion_error(pub_2)
}
end
...
...
@@ -111,7 +106,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
}
fail_if_connecttion_error(multi)
}
end
...
...
@@ -128,7 +122,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Channel id not authorized for this method.",pub_1.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
end
...
...
@@ -153,7 +146,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(413,pub_1.response_header.status,"Request was accepted")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
end
...
...
@@ -178,7 +170,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(200,pub_1.response_header.status,"Request was not accepted")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
end
...
...
@@ -203,7 +194,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(200,pub_1.response_header.status,"Request was not accepted")
EventMachine.stop
}
fail_if_connecttion_error(pub_1)
}
end
...
...
@@ -228,9 +218,7 @@ class TestPublisher < Test::Unit::TestCase
@@ -41,7 +41,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
}
fail_if_connecttion_error(multi)
}
end
...
...
@@ -56,7 +55,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("No channel id provided.",sub.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub)
}
end
...
...
@@ -84,7 +82,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
}
fail_if_connecttion_error(multi)
}
end
...
...
@@ -104,7 +101,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Channel id is too large.",sub.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub)
}
end
...
...
@@ -120,7 +116,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Channel id not authorized for this method.",sub_1.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -161,7 +156,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
}
fail_if_connecttion_error(multi)
}
end
...
...
@@ -202,7 +196,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
}
fail_if_connecttion_error(multi)
}
end
...
...
@@ -222,7 +215,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Subscriber could not create channels.",sub_1.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -245,7 +237,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(200,sub_1.response_header.status,"Channel was founded")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -272,7 +263,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal(200,sub_1.response_header.status,"Channel was founded")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -299,7 +289,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Subscriber could not create channels.",sub_1.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -329,7 +318,6 @@ class TestPublisher < Test::Unit::TestCase
assert_equal("Subscriber could not create channels.",sub_1.response_header['X_NGINX_PUSHSTREAM_EXPLAIN'],"Didn't receive the right error message")
EventMachine.stop
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -390,7 +378,6 @@ class TestPublisher < Test::Unit::TestCase
EventMachine.stop
end
}
fail_if_connecttion_error(sub_1)
}
end
...
...
@@ -451,25 +438,13 @@ class TestPublisher < Test::Unit::TestCase