Skip to content

rbell#87

Open
rabGIT wants to merge 2 commits into
vikingeducation:masterfrom
rabGIT:master
Open

rbell#87
rabGIT wants to merge 2 commits into
vikingeducation:masterfrom
rabGIT:master

Conversation

@rabGIT

@rabGIT rabGIT commented Apr 11, 2017

Copy link
Copy Markdown

No description provided.

Comment thread spec/calculator_spec.rb
require 'calculator'

describe Calculator do
describe '#initialize ' do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

create a common instance for Calculator and use it throughout the specs.
let(:c) { Calculator.new }

Comment thread spec/calculator_spec.rb
expect(Calculator.new.divide(3.6, 1.2)).to eq(3)
end
it 'properly handles negative numbers with positive result' do
expect(Calculator.new.divide(-4, -2)).to eq(2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

raises ArgumentError for negative second argument

Comment thread spec/calculator_spec.rb
it 'returns an Integer when no remainder' do
expect(Calculator.new.divide(4, 2)).to be_a(Integer)
end
it 'returns an Integer ' do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

returns a Float for division with remainder.

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