Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions slides/rspec.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ RSpec.describe User, 'with some elements' do

describe 'with another name' do
let(:params) { { name: 'Mark', position: 'PM' } }

it { expect(user.name).to eql('Mark') }
end
end
Expand Down Expand Up @@ -1698,7 +1699,7 @@ end

```ruby
it 'removes the last element' do
expect { @array.pop }.to change{ @array.size }.by(1)
expect { @array.pop }.to change{ @array.size }.by(-1)
end

it 'removes the last element' do
Expand All @@ -1710,11 +1711,11 @@ it 'removes the last element' do
end

it 'changes size by at least 1' do
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_least(1)
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_least(-1)
end

it 'changes size by at most 2' do
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_most(2)
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_most(-2)
end
```

Expand Down
6 changes: 3 additions & 3 deletions slides/rspec_new.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ end

```ruby
it 'removes the last element' do
expect { @array.pop }.to change{ @array.size }.by(1)
expect { @array.pop }.to change{ @array.size }.by(-1)
end

it 'removes the last element' do
Expand All @@ -608,11 +608,11 @@ it 'removes the last element' do
end

it 'changes size by at least 1' do
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_least(1)
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_least(-1)
end

it 'changes size by at most 2' do
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_most(2)
expect { 2.times { @array.pop } }.to change{ @array.size }.by_at_most(-2)
end
```

Expand Down