Skip to content

darthschmoo/fun_with_testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fun_with_testing

A bunch of useful assertions, and a subclass of Test::Unit::TestCase for my gems to derive from.

Usage:

# This might go in test/helper.rb, for example
class GemTestCase < FunWith::Testing::TestCase
  install_basic_assertions
end

Then in test/test_gem.rb:

class MyUnitTest < GemTestCase
  def test_my_thing
    assert_zero( 0 )
    assert_not_zero( 1 )
    assert_has_method( 1, :to_s )
    # ... and so on down the line
  end
end

In the FunWith gems, gem tests use a subclass of FunWith::Testing::TestCase, a subclass of Test::Unit::TestCase with some helpful methods.

#_should() : ignores the inner block, instead prints a message warning that the test is being skipped
#_context() : ignores the inner block, instead prints a message warning that the set of tests is being skipped.

Contributing to fun_with_testing

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2014 Bryce Anderson. See LICENSE.txt for further details.

About

A collection of useful assertions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages