Class: Parklife::Browser
- Inherits:
-
Object
- Object
- Parklife::Browser
- Defined in:
- lib/parklife/browser.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(app, base) ⇒ Browser
constructor
A new instance of Browser.
- #uri_for(path) ⇒ Object
Constructor Details
#initialize(app, base) ⇒ Browser
Returns a new instance of Browser.
10 11 12 13 14 15 |
# File 'lib/parklife/browser.rb', line 10 def initialize(app, base) @app = app @base = base @session = Rack::Test::Session.new(app) set_env end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/parklife/browser.rb', line 8 def app @app end |
#base ⇒ Object (readonly)
Returns the value of attribute base.
8 9 10 |
# File 'lib/parklife/browser.rb', line 8 def base @base end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
8 9 10 |
# File 'lib/parklife/browser.rb', line 8 def env @env end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
8 9 10 |
# File 'lib/parklife/browser.rb', line 8 def session @session end |
Instance Method Details
#get(path) ⇒ Object
17 18 19 |
# File 'lib/parklife/browser.rb', line 17 def get(path) session.get(path, nil, env) end |
#uri_for(path) ⇒ Object
21 22 23 |
# File 'lib/parklife/browser.rb', line 21 def uri_for(path) base.dup.tap { |uri| uri.path = path } end |