Created
August 18, 2017 20:50
-
-
Save geiltonxavier/25fc72c32bc1188431c2d507c4d17f2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 './nama.rb' | |
describe "Nama Multiplos" do | |
before do | |
@nn = Nama.new | |
end | |
it "retorna multiplos de 5" do | |
@nn.print(5).must_equal "Nama" | |
end | |
it "retorna multiplos de 7" do | |
@nn.print(7).must_equal "Team" | |
end | |
it "retorna multiplos de 35" do | |
@nn.print(70).must_equal "Nama Team" | |
end | |
it "retorna erro se o numero for negativo" do | |
proc {@nn.print(-1)}.must_raise ArgumentError | |
end | |
it "retorna erro se o numero for zero" do | |
proc {@nn.print(0)}.must_raise ArgumentError | |
end | |
it "retorna erro se o numero não for inteiro" do | |
proc {@nn.print(1.5)}.must_raise ArgumentError | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment