Skip to content

warmup complete#80

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

warmup complete#80
laconiccrafts wants to merge 2 commits into
vikingeducation:masterfrom
laconiccrafts:master

Conversation

@laconiccrafts

Copy link
Copy Markdown

No description provided.

Comment thread spec/calculator_spec.rb

describe "#multiply" do
it "multiplies two integers" do
expect(calc.multiply(2,3)).to eq(6)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

also, check for negative integers and floats.

Comment thread spec/calculator_spec.rb

it "raises negative numbers to their power" do
expect(calc.pow(-2,4)).to eq((-2)**4)
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

also, check the cases when power is 0, negative and decimal.

Comment thread spec/calculator_spec.rb
end

it "returns 2-digit decimals for non-round roots" do
expect(calc.sqrt(2)).to eq(1.41)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

check if the result has 2 decimal places exactly.

Comment thread spec/calculator_spec.rb
it "turns the output of functions into a string if the stringify \
input is passed to a new calculator" do
c2 = Calculator.new(true)
expect(c2.add(1,2)).to eq("3")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

check this for all operations - subtract, multiply, divide etc

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