Skip to content

Instantly share code, notes, and snippets.

@brookr
Created May 31, 2012 19:54
Show Gist options
  • Save brookr/2845814 to your computer and use it in GitHub Desktop.
Save brookr/2845814 to your computer and use it in GitHub Desktop.
A basic Table class
# 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