Skip to content

Commit

Permalink
Add the initialize tests for Person, Student, book
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekyHacks committed Oct 27, 2023
1 parent 41efc54 commit eb8637c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/book_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require './book'

describe Book.new 'Microverse', 'Autum Johe' do
it { is_expected.to have_attributes(title: 'Microverse') }
it { is_expected.to have_attributes(author: 'Autum Johe') }
end
7 changes: 7 additions & 0 deletions spec/person_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require './person'

describe Person.new 23, 'Abdu' do
it{is_expected.to have_attributes(age: 23) }
it{is_expected.to have_attributes(name: 'Abdu') }
it{is_expected.to have_attributes(parent_permission: true) }
end
9 changes: 9 additions & 0 deletions spec/student_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require './student'

describe Student.new 'IT', 24, 'Abdu' do

it{is_expected.to have_attributes(classroom: 'IT') }
it{is_expected.to have_attributes(age: 24) }
it{is_expected.to have_attributes(name: 'Abdu') }
it{is_expected.to have_attributes(parent_permission: true) }
end

0 comments on commit eb8637c

Please sign in to comment.