Class: StoredReporter::ContextResult

Inherits:
Object
  • Object
show all
Defined in:
lib/dashboard/stored_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ContextResult

Returns a new instance of ContextResult.



5
6
7
8
9
10
11
12
# File 'lib/dashboard/stored_reporter.rb', line 5

def initialize context
  @fails = []
  @passes = []
  @requests = []
  @children = []
  
  @desc = context.description
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



3
4
5
# File 'lib/dashboard/stored_reporter.rb', line 3

def children
  @children
end

#descObject

Returns the value of attribute desc.



3
4
5
# File 'lib/dashboard/stored_reporter.rb', line 3

def desc
  @desc
end

#failsObject

Returns the value of attribute fails.



3
4
5
# File 'lib/dashboard/stored_reporter.rb', line 3

def fails
  @fails
end

#passesObject

Returns the value of attribute passes.



3
4
5
# File 'lib/dashboard/stored_reporter.rb', line 3

def passes
  @passes
end

#requestsObject

Returns the value of attribute requests.



3
4
5
# File 'lib/dashboard/stored_reporter.rb', line 3

def requests
  @requests
end

Instance Method Details

#fail(fail) ⇒ Object



14
15
16
# File 'lib/dashboard/stored_reporter.rb', line 14

def fail fail
  @fails << fail
end

#pass(pass) ⇒ Object



18
19
20
# File 'lib/dashboard/stored_reporter.rb', line 18

def pass pass
  @passes << pass
end

#passed?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
# File 'lib/dashboard/stored_reporter.rb', line 22

def passed?
  return false unless fails.empty?
  
  children.each do |c|
    return false unless c.passed?
  end
  
  return true
end