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