Skip to content

Instantly share code, notes, and snippets.

@satococoa
Created June 16, 2013 10:44
Show Gist options
  • Select an option

  • Save satococoa/5791667 to your computer and use it in GitHub Desktop.

Select an option

Save satococoa/5791667 to your computer and use it in GitHub Desktop.
標準添付の minitest だけでもこのくらい書ける
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