module RSpec::Clone::ExpectationHelper::It

{RSpec::Clone::Dsl.it}'s expectation helper module.

Public Instance Methods

expect(value = self.class.superclass, &block) click to toggle source

Create an expectation for a spec.

@param value [#object_id, nil] An actual value. @param block [#call, nil] A code to evaluate.

@return [Block, Value] The wrapped target of an expectation.

@example

expect("foo") # => #<RSpec::Clone::ExpectationTarget::Value:0x00007f @actual="foo">
expect { RSpec::Clone::Boom! } # => #<RSpec::Clone::ExpectationTarget::Block:0x... @callable=#<Proc:0x...>>

@api public

# File lib/r_spec/clone/expectation_helper/it.rb, line 25
def expect(value = self.class.superclass, &block)
  ExpectationTarget.call(self.class.superclass, value, block)
end
is_expected() click to toggle source

Wraps the target of an expectation with the subject as actual value.

@return [Block] The wrapped target of an expectation.

@example

is_expected # => #<RSpec::Clone::ExpectationTarget::Block:0x00007fb6b8 @callable=#<Proc:0x00007fb6b8>>

@api public

# File lib/r_spec/clone/expectation_helper/it.rb, line 37
def is_expected
  expect { subject }
end