Permalink
Browse files

Fixed a regression in the HTML formatter's #embed implementation. Closes

 #77.
  • Loading branch information...
1 parent 39891e2 commit 45c74e3733f627f9cf09feb174b15a1d91dff0e7 @aslakhellesoy aslakhellesoy committed Jun 6, 2011
View
@@ -1,3 +1,8 @@
+== 0.10.6 (2011-06-07)
+
+=== Bugfixes
+* Fixed a regression in the HTML formatter's #embed implementation (#77 Aslak Hellesøy)
+
== 0.10.5 (2011-06-06)
(0.10.4 was forgotten!)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,3 +1,4 @@
+require 'base64'
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
$KCODE = 'u' unless Cucumber::RUBY_1_9
@@ -16,3 +17,10 @@
After('@background_tagged_before_on_outline') do
@cukes.should == '888'
end
+
+After do
+ png = IO.read(File.join(File.dirname(__FILE__), 'bubble_256x256.png'))
+ encoded_img = Base64.encode64(png).gsub(/\n/, '')
+ embed("data:image/png;base64,#{encoded_img}", 'image/png')
+end
+
@@ -9,7 +9,7 @@ Feature: Delayed message
end
Given /^I use multiple putss$/ do x=1
- announce("Multiple")
+ puts("Multiple")
puts("Announce","Me")
end

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -21,6 +21,7 @@ def initialize(step_mother, path_or_io, options)
@step_number = 0
@header_red = nil
@delayed_messages = []
+ @img_id = 0
end
def embed(src, mime_type, label)
@@ -31,7 +32,8 @@ def embed(src, mime_type, label)
end
def embed_image(src, label)
- id = file.hash
+ id = "img_#{@img_id}"
+ @img_id += 1
@builder.span(:class => 'embed') do |pre|
pre << %{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = (img.style.display == 'none' ? 'block' : 'none');return false">#{label}</a><br>&nbsp;
<img id="#{id}" style="display: none" src="#{src}"/>}

0 comments on commit 45c74e3

Please sign in to comment.