Skip to content
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

Panda & Tiger: Done. Eagle: confused. #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mjvezzani
Copy link

Not quite sure where to go with the eagle requirements to keep track of number of vehicles made. See failing test.

describe Vehicle do

it "tracks the number of vehicles created" do
Motorcycle.new.should change{@@vehicles_made}.by(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start by getting the correct test.

You have added a test that checks a global variable @@vehicles_made --- not the Vehicle's class variable @@vehicles_made

So, our test should reference that. In additional, the "should change" requires a bit of a different syntax

describe Vehicle do 
    it "tracks the number of vehicles created" do
      expect {
        Motorcycle.new
      } .to change{Vehicle.vehicle_count}.by(1)
    end
end

Then, to get this to pass, we add a method to Vehicle

    def self.vehicle_count
      @@vehicles_made
    end

@jwo
Copy link
Member

jwo commented Jan 28, 2014

OK, let me know if that makes sense or not... Also, you'll probably need to rethink something (minor) to accomplish the last task in eagle:

Create a class method that let's you filter the vehicles to only blue honda accords (using our enumerable filters)

The rest of your code looks excellent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants