-
-
Save takai/2416473 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'テスト対象' do | |
context '状態' do | |
describe 'テスト対象メソッド' do | |
context '与える入力' do | |
it '期待する出力' | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
its (:size) { should eq 10 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
end | |
context 'when stack is full' do | |
end | |
context 'when stack is not empty or full' do | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
describe 'SymbolStack#size' do | |
end | |
describe 'SymbolStack#push' do | |
end | |
describe 'SymbolStack#pop' do | |
end | |
end | |
context 'when stack is full' do | |
describe 'SymbolStack#size' do | |
end | |
# 以下省略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
describe 'SymbolStack#size' do | |
end | |
describe 'SymbolStack#push' do | |
context 'with symbol' do | |
end | |
context 'with non-symbol' do | |
end | |
end | |
describe 'SymbolStack#pop' do | |
end | |
# 以下省略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
describe 'SymbolStack#size' do | |
it 'returns 0' | |
end | |
describe 'SymbolStack#push' do | |
context 'with symbol' do | |
it 'increments stack size' | |
end | |
context 'with non-symbol' do | |
it 'raise error' | |
end | |
end | |
describe 'SymbolStack#pop' do | |
it 'raise error' | |
end | |
# 以下省略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
# 中略 | |
context 'when stack is full' do | |
before do | |
10.times {|i| subject.push(:"data#{i}") } | |
end | |
# 中略 | |
context 'when stack is not empty or full' do | |
before do | |
subject.push(:data) | |
end | |
# 以下省略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe SymbolStack do | |
context 'when stack is empty' do | |
describe 'SymbolStack#size' do | |
it 'returns 0' do | |
subject.size.should eq 0 | |
end | |
end | |
describe 'SymbolStack#push' do | |
context 'with symbol' do | |
it 'increments stack size' do | |
expect { subject.push(:data) }. | |
to change { subject.size }.from(0).to(1) | |
end | |
end | |
context 'with non-symbol' do | |
it 'raise error' do | |
expect { subject.push('data') }.to raise_error | |
end | |
end | |
end | |
describe 'SymbolStack#pop' do | |
it 'raise error' do | |
expect { subject.pop }.to raise_error | |
end | |
end | |
end | |
# 以下省略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'returns 0' do | |
subject.size.should eq 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment