Skip to content

Instantly share code, notes, and snippets.

@bguthrie
Last active April 20, 2017 19:52
Show Gist options
  • Save bguthrie/3fafdf4a5b569a432226b57ceaabaec7 to your computer and use it in GitHub Desktop.
Save bguthrie/3fafdf4a5b569a432226b57ceaabaec7 to your computer and use it in GitHub Desktop.
describe SomeClass do
describe '#some_method' do
def actual(parameter)
described_class.some_method(parameter)
end
it 'expresses behavior 1' do
expect(
actual('base_value')
).to eq('expected 1')
end
it 'expresses behavior 2' do
expect(
actual('other_value')
).to eq('expected 2')
end
it 'expresses behavior 1' do
expect(
actual('new_value')
).to eq('expected 3')
end
end
end
describe SomeClass do
describe '#some_method' do
let(:actual) { described_class.some_method(a_parameter) }
let(:a_parameter) { 'base_value' }
describe 'case 1' do
it 'expresses behavior 1' do
expect(actual).to eq('expected 1')
end
end
describe 'case 2' do
let(:a_parameter) { 'other_value' }
it 'expresses behavior 2' do
expect(actual).to eq('expected 2')
end
end
describe 'case 3' do
let(:a_parameter) { 'new_value' }
it 'expresses behavior 3' do
expect(actual).to eq('expected 3')
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment