Question
Provide a line by line explanation of the following code: Label each part of your explanation according to the line(s) you are describing. Be sure
Provide a line by line explanation of the following code:
Label each part of your explanation according to the line(s) you are describing. Be sure to explain the code in
DETAIL, including what is being called, any expected output, the keywords and what they mean etc. It will be
graded as follows:
(1 point) Line 1
(1 point) Line 2
(1 point) Lines 3-6
(1 point) Lines 8-10
(1 point) Lines 13-15
(1 point) Line 17
(1 point) Lines 19-21
Provide a line by line explanation of the following RSpec code:Label each part of your explanation according to the line(s) you are describing. Be sure to explain the code in
DETAIL, including what is being called, what is the expected response, the keywords and what they mean etc.
Your response will be graded as follows:
(1 point) Lines 23-24
(1 point) Lines 26-28
(1 point) Lines 29-30
(1 point) Lines 32-35
(1 point) Lines 36-39
1 class Career 2 attr_accessor:name, :job def initialize(name, job) 4 @name = name @job job end def description end 7 "I'm #{@name} and I am a #{@job}!" 9 10 11 end 12 13 john Career.newC" John", "firefighter") 14 jane Career.newC"Jane", "police officer") 15 jarvis - Career.newC"Jarvis", "butler") 16 17 john.job- "parametic" 18 19 puts john.description 20 puts jane.description 21 puts jarvis.description puts 23 describe Careerdo 24- 25 26 27 28 29 30 31 32 describe 'career getters and setters' do beforeC:each) @careers Career.newC"John", "firefighter" it 'should set name' do expect(@careers.name).to eq('John' ) end it 'should set job' do expect(@careers.job).to eq("firefighter") end it 'should be able to change name' do @careers.name - 'Jonathan' expect(@careers.name).to eq('Jonathan') 34 35 36 37 38 39 40 41 end end it 'should be able to change job' do @careers.job - "Parametic" expect(@careers.job).to eqC" Parametic") end endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started