Use rand instead of Random.rand for Ruby 1.8 compatibility

This commit is contained in:
Jo Liss 2011-03-04 14:40:40 +01:00
parent e1ba3c4dfb
commit 47dbcdfdf0
1 changed files with 1 additions and 1 deletions

View File

@ -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")}#{Random.rand(10**10)}.html"
file_name ||= "capybara-#{Time.new.strftime("%Y%m%d%H%M%S")}#{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 )