Class: RSpecHTML::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_html/browser.rb

Overview

Convenience utility for loading a provided path in the operating system’s default browser. Used for inspecting documents while debugging tests.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Browser

Returns a new instance of Browser.



11
12
13
# File 'lib/rspec_html/browser.rb', line 11

def initialize(path)
  @path = path
end

Class Method Details

.open(path) ⇒ Object



7
8
9
# File 'lib/rspec_html/browser.rb', line 7

def self.open(path)
  new(path).open
end

Instance Method Details

#openObject



15
16
17
18
# File 'lib/rspec_html/browser.rb', line 15

def open
  log_launch_browser_event
  system `#{command} '#{path}'`
end