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

Jack Chester Solutions #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jack-chester
Copy link

@jaybobo @matt529

end

def add_apples
(1..10).each do |idx|
Copy link
Member

Choose a reason for hiding this comment

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

Could you also do something like this...

10.times { @apples.push Apple.new("Red", rand(4..6)) }

I'd assume the diameter would have less of a variance :)

https://ruby-doc.org/core-2.2.2/Integer.html#method-i-times

end

it 'ages one year' do
expect(testTree.age).to eq(1)
Copy link
Member

Choose a reason for hiding this comment

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

2 spaces

@@ -1,14 +1,66 @@
require 'rspec'
require 'tree'

testTree = Tree.new

describe 'Tree' do
Copy link
Member

Choose a reason for hiding this comment

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

describe Tree do will work.

Then you can do stuff like described_class.new.age! or even subject { described_class.new }

Copy link
Member

Choose a reason for hiding this comment

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

Also check this out... www.betterspecs.org/#let

end
end

describe 'Fruit' do
it 'is a Class' do
expect(Fruit.is_a? Class).to be true
Copy link
Member

Choose a reason for hiding this comment

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

2 spaces

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.

2 participants