test/unit/runner_tests.rb in deas-0.40.0 vs test/unit/runner_tests.rb in deas-0.41.0
- old
+ new
@@ -137,17 +137,16 @@
end
should "know and set its response body" do
assert_nil subject.body
- exp = Factory.string
+ exp = [Factory.string]
subject.body exp
assert_equal exp, subject.body
- assert_raises(ArgumentError) do
- subject.body Factory.integer
- end
+ subject.body exp.first
+ assert_equal exp, subject.body
end
should "know and set its response content type header" do
extname = ".#{Factory.string}"
@@ -461,11 +460,11 @@
end
class SourceRenderTests < RenderSetupTests
desc "source render method"
setup do
- body = @body = Factory.text
+ body = @body = [Factory.text]
@render_called_with = nil
@source = Deas::TemplateSource.new(Factory.path)
Assert.stub(@source, :render){ |*args| @render_called_with = args; body }
end
@@ -670,10 +669,10 @@
end
class NonPartialSendFileBodyTests < SendFileBodyIOTests
desc "for non/multi/invalid partial content requests"
setup do
- range = [nil, 'bytes=', 'bytes=0-1,2-3', 'bytes=3-2', 'bytes=abc'].choice
+ range = [nil, 'bytes=', 'bytes=0-1,2-3', 'bytes=3-2', 'bytes=abc'].sample
env = range.nil? ? {} : { 'HTTP_RANGE' => range }
@body = SendFileBody.new(env, @path_name)
end
should "not be partial" do