Created
August 23, 2011 03:18
-
-
Save blowmage/1164256 to your computer and use it in GitHub Desktop.
Flog Example
This file contains 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
module Hello | |
def self.speak | |
"Hello world!" | |
end | |
end |
This file contains 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
# Note we are requiring Flog before any other rake task | |
# This fails with "uninitialized constant Rake::TaskLib" | |
require "flog_task" | |
FlogTask.new do |t| | |
t.verbose = true | |
end | |
# If we require this before flog_task then it will load fine | |
require "rake/testtask" | |
Rake::TestTask.new do |t| | |
t.libs << "lib" << "test" | |
t.pattern = "test/**/test_*.rb" | |
t.verbose = true | |
end |
This file contains 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 "test/unit" | |
require "hello" | |
class TestHello < Test::Unit::TestCase | |
def test_can_speak | |
assert_equal "Hello world!", Hello.speak | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment