Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'test/unit'
- require 'testing'
- class Teste_calc < Test::Unit::TestCase
- def setup
- @calc = Calculadora.new
- end
- def test_soma
- assert_equal(2, @calc.soma(1,1),"1 + 2 = 2")
- end
- def test_subtrai
- assert_equal(3,@calc.subtrai(7,4),"7 - 4 = 3")
- assert_equal(-3,@calc.subtrai(4,7),"4 - 7 = -3")
- end
- def test_multiplica
- assert_equal(4,@calc.multiplica(2.2),"2 X 2 = 4")
- end
- def test_divide
- assert_equal(2,@calc.divide(4,2),"4/2=2 ")
- end
- def banana
- puts "bla"
- end
- def teardown
- @calc = nil
- end
- end
Add Comment
Please, Sign In to add comment