Class: ODDB::State::TestGlobal::StubSession

Inherits:
Object
  • Object
show all
Defined in:
test/test_state/global.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) request_path

Returns the value of attribute request_path



30
31
32
33
# File 'test/test_state/global.rb', line 30

def request_path
  # disable self-caching for tests
  @rp = @rp.to_i.next
end

- (Object) user_input(*keys)

Returns the value of attribute user_input



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'test/test_state/global.rb', line 30

def user_input(*keys)
  if(keys.size > 1)
    res = {}
    keys.each { |key|
      res.store(key, user_input(key))
    }
    res
  else
    key = keys.first
    (@user_input ||= {
      :pointer =>  StubPointer.new
    })[key]
  end
end

Instance Method Details

- (Boolean) allowed?(foo, bar)

Returns:

  • (Boolean)


48
49
50
# File 'test/test_state/global.rb', line 48

def allowed?(foo, bar)
  true
end

- (Object) app



31
32
33
# File 'test/test_state/global.rb', line 31

def app
  @app ||= StubApp.new
end

- (Object) user



51
52
53
# File 'test/test_state/global.rb', line 51

def user
  self
end