Skip to content

Commit

Permalink
Allow for more than one save_and_open_page call per second
Browse files Browse the repository at this point in the history
  • Loading branch information
joliss committed Mar 1, 2011
1 parent 3d0867f commit 398e942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/util/save_and_open_page.rb
@@ -1,7 +1,7 @@
module Capybara
class << self
def save_page(html, file_name=nil)
file_name ||= "capybara-#{Time.new.strftime("%Y%m%d%H%M%S")}.html"
file_name ||= "capybara-#{Time.new.strftime("%Y%m%d%H%M%S")}#{Random.rand(10**10)}.html"
name = File.join(*[Capybara.save_and_open_page_path, file_name].compact)

unless Capybara.save_and_open_page_path.nil? || File.directory?(Capybara.save_and_open_page_path )
Expand Down

0 comments on commit 398e942

Please sign in to comment.