Skip to content

Conversation

@jack-chester
Copy link

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


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


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