features/step_definitions/httpthumbnailer_steps.rb in httpthumbnailer-1.1.1 vs features/step_definitions/httpthumbnailer_steps.rb in httpthumbnailer-1.1.2

- old
+ new

@@ -44,18 +44,18 @@ parser.ended?.should be_true @response_multipart.should_not be_empty end -Then /response body should be CRLF endend lines like/ do |body| +Then /response body should be CRLF endend lines like/ do |body| @response.body.should match(body) @response.body.each_line do |line| line[-2,2].should == "\r\n" end end -Then /response body should be CRLF endend lines$/ do |body| +Then /response body should be CRLF endend lines$/ do |body| @response.body.should == body.gsub("\n", "\r\n") + "\r\n" end Then /response status should be (.*)/ do |status| @response.status.should == status.to_i @@ -71,15 +71,15 @@ Then /^([^ ]+) part (.*) header should be (.*)/ do |part, header, value| @response_multipart[part_no(part)].headers[header.downcase].should == value end -Then /^([^ ]+) part body should be CRLF endend lines$/ do |part, body| +Then /^([^ ]+) part body should be CRLF endend lines$/ do |part, body| @response_multipart[part_no(part)].body.should == body.gsub("\n", "\r\n") end -Then /^([^ ]+) part body should be CRLF endend lines like$/ do |part, body| +Then /^([^ ]+) part body should be CRLF endend lines like$/ do |part, body| pbody = @response_multipart[part_no(part)].body pbody.should match(body) end Then /response should contain (.*) image of size (.*)x(.*)/ do |format, width, height| @@ -128,10 +128,14 @@ And /that image pixel at (.*)x(.*) should be of color (.*)/ do |x, y, color| @image.pixel_color(x.to_i, y.to_i).to_color.sub(/^#/, '0x').should == color end And /that image should be (.*) bit image/ do |bits| - @image.depth.should == bits.to_i + if @image.depth < 8 + (@image.depth * 8).should == bits.to_i # newer versions return 1 for 8 bit?! + else + @image.depth.should == bits.to_i + end end And /there should be no leaked images/ do Integer(http_client.get_content("http://localhost:3100/stats/images_loaded").strip).should == 0 end