From: Devin Mullins Date: 2007-01-24T13:15:58+09:00 Subject: Re: I don't get rspec Eric Hodel wrote: > class TestStack < Test::Unit::TestCase > > def setup > @s = Stack.new > end > > def test_empty_eh > assert @s.empty? > @s.push 1 > deny @s.empty? > end > > def test_push > @s.push 1 > deny @s.empty? > assert_equal 1, @s.top > end > > def test_top > assert_nil @s.top > @s.push 1 > assert_equal 1, @s.top > end > > end Each one of these test methods invokes multiple methods on Stack. You're not testing a method, you're testing the interaction between several methods -- i.o.w. a call sequence. Looking at the contents of each, it's not clear that one method really is prominent -- i.e. is test_push testing #push, #empty?, or #top ? Question -- what would you name: def test_??? @s.push 1 @s.pop assert @s.empty? end or would you merge it in with test_empty_eh ? Devin