Module: Moarspec::Its
- Defined in:
- lib/moarspec/its.rb,
lib/moarspec/its/map.rb,
lib/moarspec/its/call.rb,
lib/moarspec/its/with.rb,
lib/moarspec/its/block.rb,
lib/moarspec/its/block_with.rb
Overview
Wrapper module for all ‘its_*` RSpec additions.
## #its_map
“‘ruby subject { %w[1 2 3] } its_map(:to_s) { is_expected.to eq [1, 2, 3] } “`
## #its_call
“‘ruby subject { [1, 2, 3].method(:[]) } its_call(2) { is_expected.to ret 3 } its_call(’foo’) { is_expected.to raise_error } “‘
## #its_block
“‘ruby subject { something_action } its_block { is_expected.not_to raise_error } its_block { is_expected.to change(some, :value).by(1) } “`
## #it_with
“‘ruby subject { x + y } it_with(x: 1, y: 2) { is_expected.to eq 3 } “`
“‘ruby subject { x + y } its_block_with(x: 1, y: nil) { is_expected.to raise_error } “`