Class: Webspicy::Specification::TestCase
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#method_missing, #to_info
Constructor Details
#initialize(raw) ⇒ TestCase
Returns a new instance of TestCase.
6
7
8
9
|
# File 'lib/webspicy/specification/test_case.rb', line 6
def initialize(raw)
super(raw)
@counterexample = nil
end
|
Instance Attribute Details
#counterexample ⇒ Object
Returns the value of attribute counterexample.
11
12
13
|
# File 'lib/webspicy/specification/test_case.rb', line 11
def counterexample
@counterexample
end
|
#service ⇒ Object
Returns the value of attribute service.
10
11
12
|
# File 'lib/webspicy/specification/test_case.rb', line 10
def service
@service
end
|
Class Method Details
.info(raw) ⇒ Object
34
35
36
|
# File 'lib/webspicy/specification/test_case.rb', line 34
def self.info(raw)
new(raw)
end
|
Instance Method Details
#assert ⇒ Object
66
67
68
|
# File 'lib/webspicy/specification/test_case.rb', line 66
def assert
@raw[:assert] || []
end
|
#bind(service, counterexample) ⇒ Object
13
14
15
16
17
|
# File 'lib/webspicy/specification/test_case.rb', line 13
def bind(service, counterexample)
@service = service
@counterexample = counterexample
self
end
|
#counterexample? ⇒ Boolean
23
24
25
|
# File 'lib/webspicy/specification/test_case.rb', line 23
def counterexample?
!!@counterexample
end
|
#description ⇒ Object
38
39
40
|
# File 'lib/webspicy/specification/test_case.rb', line 38
def description
@raw[:description]
end
|
#example? ⇒ Boolean
19
20
21
|
# File 'lib/webspicy/specification/test_case.rb', line 19
def example?
!@counterexample
end
|
#expected ⇒ Object
54
55
56
|
# File 'lib/webspicy/specification/test_case.rb', line 54
def expected
@raw[:expected] || {}
end
|
#expected_error ⇒ Object
58
59
60
|
# File 'lib/webspicy/specification/test_case.rb', line 58
def expected_error
expected[:error]
end
|
#has_assertions? ⇒ Boolean
70
71
72
|
# File 'lib/webspicy/specification/test_case.rb', line 70
def has_assertions?
!assert.empty?
end
|
#has_expected_error? ⇒ Boolean
62
63
64
|
# File 'lib/webspicy/specification/test_case.rb', line 62
def has_expected_error?
!expected_error.nil?
end
|
46
47
48
|
# File 'lib/webspicy/specification/test_case.rb', line 46
def metadata
@raw[:metadata] ||= {}
end
|
#mutate(override) ⇒ Object
74
75
76
77
78
|
# File 'lib/webspicy/specification/test_case.rb', line 74
def mutate(override)
m = self.dup
m.raw = self.raw.merge(override)
m
end
|
#seeds ⇒ Object
42
43
44
|
# File 'lib/webspicy/specification/test_case.rb', line 42
def seeds
@raw[:seeds]
end
|
#specification ⇒ Object
Also known as:
resource
27
28
29
|
# File 'lib/webspicy/specification/test_case.rb', line 27
def specification
service.specification
end
|
50
51
52
|
# File 'lib/webspicy/specification/test_case.rb', line 50
def tags
@raw[:tags] ||= []
end
|
#to_s ⇒ Object
80
81
82
|
# File 'lib/webspicy/specification/test_case.rb', line 80
def to_s
description
end
|