diff --git a/Gemfile b/Gemfile index 813f92b..c2adb39 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,9 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gem 'rubocop', '>= 1.0', '< 2.0' gem 'json' -gem "rspec" +gem 'rspec' diff --git a/spec/classroom_spec.rb b/spec/classroom_spec.rb index 9dee420..abf3864 100644 --- a/spec/classroom_spec.rb +++ b/spec/classroom_spec.rb @@ -11,8 +11,8 @@ end it 'can add students' do - student1 = Student.new(classroom, 18, 'Alice') # Provide age and name - student2 = Student.new(classroom, 19, 'Bob') # Provide age and name + student1 = Student.new(classroom, 18, 'Alice') + student2 = Student.new(classroom, 19, 'Bob') classroom.add_student(student1) classroom.add_student(student2) diff --git a/spec/person_spec.rb b/spec/person_spec.rb index 07f091a..d179bf8 100644 --- a/spec/person_spec.rb +++ b/spec/person_spec.rb @@ -1,7 +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 \ No newline at end of file + 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 diff --git a/spec/rental_spec.rb b/spec/rental_spec.rb index b54f58e..54c6fb7 100644 --- a/spec/rental_spec.rb +++ b/spec/rental_spec.rb @@ -17,4 +17,4 @@ expect(book.rentals).to contain_exactly(rental) expect(person.rentals).to contain_exactly(rental) end -end \ No newline at end of file +end diff --git a/spec/student_spec.rb b/spec/student_spec.rb index d6ff910..5c4738d 100644 --- a/spec/student_spec.rb +++ b/spec/student_spec.rb @@ -1,9 +1,9 @@ require './student' describe Student.new 'IT', 24, 'Abdu' do - it { is_expected.to be_a(Person) } - 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 \ No newline at end of file + it { is_expected.to be_a(Person) } + 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 diff --git a/spec/teacher_spec.rb b/spec/teacher_spec.rb index c5b9930..91c7ad1 100644 --- a/spec/teacher_spec.rb +++ b/spec/teacher_spec.rb @@ -3,9 +3,9 @@ describe Teacher do subject(:teacher) { described_class.new('Math', 35, 'John Doe') } - it { is_expected.to be_a(Person) } # Ensure Teacher is a subclass of Person + it { is_expected.to be_a(Person) } it { is_expected.to have_attributes(specialization: 'Math', age: 35, name: 'John Doe') } - + it 'can use services' do expect(teacher.can_use_services?).to be(true) end