Class: Spec::Matchers::BaseOperatorMatcher
- Inherits:
-
Object
- Object
- Spec::Matchers::BaseOperatorMatcher
show all
- Defined in:
- lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseOperatorMatcher.
6
7
8
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 6
def initialize(given)
@given = given
end
|
Instance Attribute Details
#generated_description ⇒ Object
Returns the value of attribute generated_description.
4
5
6
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 4
def generated_description
@generated_description
end
|
Instance Method Details
#<(expected) ⇒ Object
35
36
37
38
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 35
def <(expected)
@expected = expected
__delegate_method_missing_to_given("<", expected)
end
|
#<=(expected) ⇒ Object
40
41
42
43
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 40
def <=(expected)
@expected = expected
__delegate_method_missing_to_given("<=", expected)
end
|
#==(expected) ⇒ Object
10
11
12
13
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 10
def ==(expected)
@expected = expected
__delegate_method_missing_to_given("==", expected)
end
|
#===(expected) ⇒ Object
15
16
17
18
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 15
def ===(expected)
@expected = expected
__delegate_method_missing_to_given("===", expected)
end
|
#=~(expected) ⇒ Object
20
21
22
23
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 20
def =~(expected)
@expected = expected
__delegate_method_missing_to_given("=~", expected)
end
|
#>(expected) ⇒ Object
25
26
27
28
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 25
def >(expected)
@expected = expected
__delegate_method_missing_to_given(">", expected)
end
|
#>=(expected) ⇒ Object
30
31
32
33
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 30
def >=(expected)
@expected = expected
__delegate_method_missing_to_given(">=", expected)
end
|
#description ⇒ Object
49
50
51
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 49
def description
"#{@operator} #{@expected.inspect}"
end
|
#fail_with_message(message) ⇒ Object
45
46
47
|
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 45
def fail_with_message(message)
Spec::Expectations.fail_with(message, @expected, @given)
end
|