Module: RSpec::CollectionMatchers::Syntax

Defined in:
lib/rspec/collection_matchers/have.rb

Defined Under Namespace

Modules: ExpectExpressionGenerator, ShouldExpressionGenerator

Class Method Summary collapse

Class Method Details

.expression_generatorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Selects which expression generator to use based on the configured syntax.



156
157
158
159
160
161
162
# File 'lib/rspec/collection_matchers/have.rb', line 156

def self.expression_generator
  if RSpec::Expectations::Syntax.expect_enabled?
    ExpectExpressionGenerator
  else
    ShouldExpressionGenerator
  end
end

.negative_expression(target_expression, matcher_expression) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generates a negative expectation expression.



150
151
152
# File 'lib/rspec/collection_matchers/have.rb', line 150

def self.negative_expression(target_expression, matcher_expression)
  expression_generator.negative_expression(target_expression, matcher_expression)
end

.positive_expression(target_expression, matcher_expression) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generates a positive expectation expression.



144
145
146
# File 'lib/rspec/collection_matchers/have.rb', line 144

def self.positive_expression(target_expression, matcher_expression)
  expression_generator.positive_expression(target_expression, matcher_expression)
end