Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe ChocolateTotalsCalculator do
- shared_examples "a fully redeemed set of chocolates" do
- it "returns a final set of chocolates: #{final_chocolates}" do
- expect(subject).to eq(final_chocolates)
- end
- end
- describe "#calculate" do
- subject { chocolate_calculator.calculate }
- context "wrappers are redeemed zero times" do
- context "row is [cash: 0, price: 0, wrappers: 0, type: 'dark']" do
- it_behaves_like "a fully redeemed set of chocolates" do
- let(:row) { CSV::Row.new(csv_headers,[0,0,0,"dark"]) }
- let(:final_chocolates) {
- {
- "milk" => 0,
- "dark" => 0,
- "white" => 0,
- "sugar free" => 0
- }
- }
- end
- end
- NameError:
- undefined local variable or method `final_chocolates' for #<Class:0x00007f9322b6c148>
Add Comment
Please, Sign In to add comment