Skip to content

Instantly share code, notes, and snippets.

@RafaelChefe
Created February 2, 2016 13:38
Show Gist options
  • Save RafaelChefe/497a4e4f7f848f47ef0a to your computer and use it in GitHub Desktop.
Save RafaelChefe/497a4e4f7f848f47ef0a to your computer and use it in GitHub Desktop.
Outra obra prima... =)
class Merda
def dar_merda
raise 'deu merda'
end
end
@wpiasecki
Copy link

require 'test/unit'

class MerdaTest < Test::Unit::TestCase

    def test_raise
        assert_raise( RuntimeError, 'devia ter dado merda' ) { Merda.new.dar_merda }
    end

end

@lunks
Copy link

lunks commented Feb 2, 2016

Meu singelo monkeypatch:

class Merda
  def self.fudeu
    new.dar_merda
  end
end

@RafaelChefe
Copy link
Author

Hahahaha, obrigado @lunks! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment