-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdragon_test.rb
52 lines (44 loc) · 1.23 KB
/
dragon_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
gem 'minitest', '~> 5.2'
require 'minitest/autorun'
require 'minitest/pride'
require_relative 'dragon'
class DragonTest < Minitest::Test
def test_it_has_a_name
dragon = Dragon.new("Ramoth", :gold, "Lessa")
assert_equal "Ramoth", dragon.name
end
def test_it_has_a_rider
dragon = Dragon.new("Ramoth", :gold, "Lessa")
assert_equal "Lessa", dragon.rider
end
def test_it_has_a_color
dragon = Dragon.new("Ramoth", :gold, "Lessa")
assert_equal :gold, dragon.color
end
def test_a_different_dragon
dragon = Dragon.new("Mnementh", :bronze, "F'lar")
assert_equal "Mnementh", dragon.name
end
def test_a_different_dragons_rider
dragon = Dragon.new("Mnementh", :bronze, "F'lar")
assert_equal "F'lar", dragon.rider
end
def test_a_different_dragons_color
dragon = Dragon.new("Mnementh", :bronze, "F'lar")
assert_equal :bronze, dragon.color
end
def test_dragons_are_born_hungry
dragon = Dragon.new("Canth", :brown, "F'nor")
assert dragon.hungry?
end
def test_dragons_eat_a_lot
dragon = Dragon.new("Canth", :brown, "F'nor")
assert dragon.hungry?
dragon.eat
assert dragon.hungry?
dragon.eat
assert dragon.hungry?
dragon.eat
refute dragon.hungry?
end
end