Module: RSpec::WillBeExpected
- Defined in:
- lib/rspec/will_be_expected.rb
Instance Method Summary collapse
-
#will_be_expected ⇒ Object
describe UserFactory do subject { UserFactory.create_user }.
Instance Method Details
#will_be_expected ⇒ Object
Note:
This only works if you are using rspec-expectations.
describe UserFactory do
subject { UserFactory.create_user }
it { will_be_expected.to change(User.count).by(1) }
it { will_be_expected.to output.to_stdout }
context 'with database issues' do
it { will_be_expected.to output.to_stderr }
it { will_be_expected.to raise_error }
end
end
29 30 31 |
# File 'lib/rspec/will_be_expected.rb', line 29 def will_be_expected expect { subject } end |