Skip to content

Instantly share code, notes, and snippets.

@geiltonxavier
Created August 18, 2017 20:50
Show Gist options
  • Save geiltonxavier/25fc72c32bc1188431c2d507c4d17f2c to your computer and use it in GitHub Desktop.
Save geiltonxavier/25fc72c32bc1188431c2d507c4d17f2c to your computer and use it in GitHub Desktop.
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