summaryrefslogtreecommitdiff
path: root/test/book_specs.rb
blob: 7b9c52f339c05d36536d96309685ae755158c67b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "Book"

class TestBook < Test::Unit::TestCase
  def test_should_be_equal
    assert_equal(Book.new("Brain Rules for Baby"), Book.new("Brain Rules for Baby"))
  end
  def test_should_not_be_equal_because_they_are_different_types
    assert_not_equal(Book.new("blah"), Game.new("blah"))
  end
  def test_should_not_be_equal_because_they_have_different_titles
    assert_not_equal(Book.new("the game"), Book.new("DDD"))
  end
end

class Game
  attr_reader :title;
  def initialize(title)
    @title=title;
  end
end