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.



167
168
169
170
171
172
173
# File 'lib/rspec/collection_matchers/have.rb', line 167

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.



161
162
163
# File 'lib/rspec/collection_matchers/have.rb', line 161

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.



155
156
157
# File 'lib/rspec/collection_matchers/have.rb', line 155

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