Class: Specter::Middleware::Fixture

Inherits:
Base
  • Object
show all
Defined in:
lib/specter/middleware/fixture.rb

Constant Summary collapse

ROOT =
Pathname.new(File.expand_path('../../fixtures', __FILE__))

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Specter::Middleware::Base

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/specter/middleware/fixture.rb', line 9

def call(env)
  data = load_fixture(env)

  if data
    env.merge!(data)
  else
    @app.call(env)
  end
end