File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ describe 'Puppy class' do
2+ let! ( :puppy ) { Puppy . new ( "brad" , "black lab" , 2 ) }
3+
4+ it 'can create a new instance of the puppy class'
5+ expect ( Puppy . new ( "brad" , "black lab" , 2 ) ) . to be_an_instance_of ( Puppy )
6+ do
7+
8+ it 'can read a puppy name' do
9+ expect ( puppy . name ) . to eq ( "brad" )
10+ end
11+
12+ it 'can read a puppy breed' do
13+ expect ( puppy . name ) . to eq ( "black lab" )
14+ end
15+
16+ it 'can read a puppy age' do
17+ expect ( puppy . name ) . to eq ( 2 )
18+ end
19+
20+ it 'can change puppy age' do
21+ puppy . age = 3
22+ expect ( puppy . age ) . to eq ( 3 )
23+ end
24+
25+ it 'can change puppy name' do
26+ puppy . name = "brad the beast"
27+ expect ( puppy . name ) . to eq ( "brad the beast" )
28+ end
29+
30+ it 'can change puppy breed' do
31+ puppy . breed = "the best black lab"
32+ expect ( puppy . breed ) . to eq ( "the best black lab" )
33+ end
34+ end
You can’t perform that action at this time.
0 commit comments