Skip to content

Instantly share code, notes, and snippets.

@boy-jer
Created April 21, 2016 04:10
Show Gist options
  • Save boy-jer/ab990b41fcaaa05bddf0108a080646fd to your computer and use it in GitHub Desktop.
Save boy-jer/ab990b41fcaaa05bddf0108a080646fd to your computer and use it in GitHub Desktop.
require 'minitest/autorun'
require_relative 'checkout'
class TestCheckoutTest < Minitest::Test
def setup
@checkout = Checkout.new('strawberry')
end
def test__product_name
assert_equal 'strawberry', @checkout.product_name
end
def test_discount
assert_equal 90, @checkout.discount
end
def test_scan
end
end
#####
class Checkout
def initialize(type)
@name = type
@bulk = true
end
def product_name
@name
end
def discount
@price = 100
@price - 10
end
def scan(type)?
if type == 'strawberry'
puts 'you have qualified for discount'
end
end
def total(num)
@ num = 50
discount * 50
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment