Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekyHacks committed Oct 27, 2023
1 parent f3c0beb commit 2c0f1c6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'rubocop', '>= 1.0', '< 2.0'

gem 'json'

gem "rspec"
gem 'rspec'
4 changes: 2 additions & 2 deletions spec/classroom_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions spec/person_spec.rb
Original file line number Diff line number Diff line change
@@ -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
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
2 changes: 1 addition & 1 deletion spec/rental_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
expect(book.rentals).to contain_exactly(rental)
expect(person.rentals).to contain_exactly(rental)
end
end
end
12 changes: 6 additions & 6 deletions spec/student_spec.rb
Original file line number Diff line number Diff line change
@@ -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
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
4 changes: 2 additions & 2 deletions spec/teacher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c0f1c6

Please sign in to comment.