Class: RSpec::Matchers::DelegateMatcher::Expected
- Inherits:
-
Object
- Object
- RSpec::Matchers::DelegateMatcher::Expected
- Includes:
- Block
- Defined in:
- lib/delegate_matcher/expected.rb
Instance Attribute Summary collapse
-
#allow_nil ⇒ Object
Returns the value of attribute allow_nil.
-
#args ⇒ Object
Returns the value of attribute args.
-
#as ⇒ Object
Returns the value of attribute as.
-
#check_return ⇒ Object
Returns the value of attribute check_return.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#return_value ⇒ Object
Returns the value of attribute return_value.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#to ⇒ Object
Returns the value of attribute to.
Attributes included from Block
Instance Method Summary collapse
- #as_args ⇒ Object
- #delegator_method_name ⇒ Object
- #description ⇒ Object
-
#initialize ⇒ Expected
constructor
A new instance of Expected.
- #prefix ⇒ Object
- #prefix=(prefix) ⇒ Object
- #to_description ⇒ Object
Methods included from Block
Constructor Details
#initialize ⇒ Expected
Returns a new instance of Expected.
10 11 12 13 |
# File 'lib/delegate_matcher/expected.rb', line 10 def initialize self.check_return = true # @args = [Mocks::ArgumentMatchers::NoArgsMatcher::INSTANCE] end |
Instance Attribute Details
#allow_nil ⇒ Object
Returns the value of attribute allow_nil.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def allow_nil @allow_nil end |
#args ⇒ Object
Returns the value of attribute args.
8 9 10 |
# File 'lib/delegate_matcher/expected.rb', line 8 def args @args end |
#as ⇒ Object
Returns the value of attribute as.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def as @as end |
#check_return ⇒ Object
Returns the value of attribute check_return.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def check_return @check_return end |
#method_name ⇒ Object
Returns the value of attribute method_name.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def method_name @method_name end |
#return_value ⇒ Object
Returns the value of attribute return_value.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def return_value @return_value end |
#subject ⇒ Object
Returns the value of attribute subject.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def subject @subject end |
#to ⇒ Object
Returns the value of attribute to.
7 8 9 |
# File 'lib/delegate_matcher/expected.rb', line 7 def to @to end |
Instance Method Details
#as_args ⇒ Object
38 39 40 |
# File 'lib/delegate_matcher/expected.rb', line 38 def as_args @as_args || args end |
#delegator_method_name ⇒ Object
46 47 48 |
# File 'lib/delegate_matcher/expected.rb', line 46 def delegator_method_name "#{prefix}#{method_name}" end |
#description ⇒ Object
50 51 52 |
# File 'lib/delegate_matcher/expected.rb', line 50 def description "delegate #{delegator_description} to #{delegate_description}#{}" end |
#prefix ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/delegate_matcher/expected.rb', line 20 def prefix case when !@has_prefix '' when @prefix "#{@prefix}_" when to[0].is_a?(String) || to[0].is_a?(Symbol) to[0].to_s.delete('@').downcase + '_' else '' end end |
#prefix=(prefix) ⇒ Object
15 16 17 18 |
# File 'lib/delegate_matcher/expected.rb', line 15 def prefix=(prefix) @has_prefix = true @prefix = prefix end |
#to_description ⇒ Object
54 55 56 |
# File 'lib/delegate_matcher/expected.rb', line 54 def to_description to.join(',') end |