Created
May 31, 2012 19:54
-
-
Save brookr/2845814 to your computer and use it in GitHub Desktop.
A basic Table class
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
# Assignment: Fill in this Table class so the tests pass! | |
class Table | |
end | |
# Unit tests | |
require 'minitest/autorun' | |
class TestTable < MiniTest::Unit::TestCase | |
def setup | |
@table = Table.new(color: "brown", seats: 4) | |
end | |
def test_that_table_has_color | |
assert_equal @table.color, "brown" | |
end | |
def test_that_table_has_seats | |
assert_equal @table.seats, 4 | |
end | |
def test_that_table_can_print_pretty | |
assert_equal "The #{@table.color} can seat #{@table.seats}", @table.pretty_print | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment