-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
questions on panda for now, will finish rest too #4
base: master
Are you sure you want to change the base?
Conversation
it "should view average grade for the class" do | ||
class_total = ClassTotal.new | ||
class_grade = ClassGrade.new | ||
average_grade = @class_grade / @class_total |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no assertion here, right? What are you testing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just put in an assertion
end | ||
|
||
def average_grade | ||
average_grade = AverageGrade.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is your "AverageGrade" class defined?
both your RSpec and cucumbers fail with these two errors:
I recommend you get your rspec passing first, and then look at cucumber. Final suggestion: you are submitting many, many episodes at once. That can't be easy to keep straight in your head. Skills build on each other. I recommend you pick one to get working, then choose another. |
Right on. |
The only thing not passing in my Rspec is the average_grade method that is clearly defined. P.S. From now on I will look to complete one assignment at a time. Good call. |
OK, so there are a couple of problems in your code. Let's start with the exception:
It's saying we are calling average_grade when it hasn't been defined. It also tells us that teacher_spec line 25 is the offending line. Let's take a look: describe AverageGrade do
it "should view average grade for the class" do
average_grade.average.should eq(class_grade/class_total)
end
end Here you are calling describe AverageGrade do
let(:average_grade) { AverageGrade.new }
it "should view average grade for the class" do
average_grade.average.should eq(class_grade/class_total)
end
end
describe AverageGrade do
it "should view average grade for the class" do
AverageGrade.new.average.should eq(class_grade/class_total)
end
end
|
OK, so let's say you do that... Then it will fail because the AverageGrade class is not setup correctly. Let's look at it class AverageGrade
def initialize
@average_grade = average_grade
@class_total = class_total
@class_grade = class_grade
end
#...
end After you do You probably wanted those as inputs to the class, but you're missing the parameters on your initialize method. |
Hmmm. Now I am getting wrong number of arguments (0 for 3) So now I think I should be making a method housing AverageGrade.new |
yeah, check out my comments here: #4 (comment) |
And more specifically, if you have a method with |
I will do Tiger and Eagle after Panda.
Cannot see why why features 7 and 8 will not pass!