mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Use rand instead of Random.rand for Ruby 1.8 compatibility
This commit is contained in:
parent
e1ba3c4dfb
commit
47dbcdfdf0
1 changed files with 1 additions and 1 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Reference in a new issue