Created
June 16, 2013 10:44
-
-
Save satococoa/5791667 to your computer and use it in GitHub Desktop.
標準添付の minitest だけでもこのくらい書ける
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
| require 'minitest/autorun' | |
| describe Array do | |
| before do | |
| @array = Array.new | |
| end | |
| describe '#push' do | |
| it '要素が追加されること' do | |
| @array.push 'foo' | |
| @array.count.must_equal 1 | |
| @array.must_equal ['foo'] | |
| end | |
| end | |
| describe '#pop' do | |
| before do | |
| @array.push 'foo' | |
| end | |
| it '要素が取り除かれること' do | |
| @array.pop | |
| @array.count.must_equal 0 | |
| end | |
| it '戻り値が取り除かれた要素であること' do | |
| @array.pop.must_equal 'foo' | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment