shared_context "constant numbers" do
  let(:one){ Constant.new(1) }
  let(:two){ Constant.new(2) }
  let(:three){ Constant.new(3) }
  let(:four){ Constant.new(4) }
  let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
  it "shows a correct string representation of #{output}" do
    expect(subject.to_s).to eq output
  end
end

shared_examples_for "a correct calculator" do |result|
  it "returns the correct result" do
    expect(subject.result).to eq result
  end
end

shared_context "constant numbers" do
  let(:one){ Constant.new(1) }
  let(:two){ Constant.new(2) }
  let(:three){ Constant.new(3) }
  let(:four){ Constant.new(4) }
  let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
  it "shows a correct string representation of #{output}" do
    expect(subject.to_s).to eq output
  end
end

shared_examples_for "a correct calculator" do |result|
  it "returns the correct result" do
    expect(subject.result).to be_within(0.01).of result
  end
end

Change precise equality in shared example to be_within matcher
Change precise equality in shared example to be_within matcher
