Method: RSpec::Core::MemoizedHelpers#is_expected

Defined in:
lib/rspec/core/memoized_helpers.rb

#is_expectedvoid

Note:

This only works if you are using rspec-expectations.

Wraps the subject in expect to make it the target of an expectation. Designed to read nicely for one-liners.

Examples:


describe [1, 2, 3] do
  it { is_expected.to be_an Array }
  it { is_expected.not_to include 4 }
end

See Also:

[View source]

120
121
122
# File 'lib/rspec/core/memoized_helpers.rb', line 120

def is_expected
  expect(subject)
end