Created
April 21, 2016 04:10
-
-
Save boy-jer/ab990b41fcaaa05bddf0108a080646fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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