Added LICENSE file and copyright notices; more general cleanup before

releasing it into the wild
This commit is contained in:
Mike Dvorkin
2010-08-21 15:24:23 -07:00
parent 255e5daaa1
commit 306abfa7f6
22 changed files with 342 additions and 74 deletions

View File

@@ -1,4 +1,14 @@
module Pit
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
module PitTest
module Date
def should_parse_alpha_dates

View File

@@ -1,5 +1,16 @@
module Pit
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
module PitTest
module Note
def should_not_segfault
`#{@pit} p -c test`
`#{@pit} t -c test`
@@ -21,5 +32,6 @@ module Pit
`#{@pit} n -e #{n} xxx`
end
end
end
end

View File

@@ -1,4 +1,14 @@
module Pit
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
module PitTest
module Project
def should_create_project
@@ -27,5 +37,6 @@ module Pit
`#{@pit} project`.should_not.match /[\s|\*] 2:/m
`#{@pit} project`.should.match /\s 1:/m
end
end
end

View File

@@ -1,4 +1,14 @@
module Pit
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
module PitTest
module Task
def should_do_cascading_task_delete

View File

@@ -1,7 +1,17 @@
#!/usr/bin/env ruby
#
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
BASE = File.dirname(File.expand_path(__FILE__))
require "#{BASE}/pit_should"
require "#{BASE}/tiny_should"
require "#{BASE}/pit_date"
require "#{BASE}/pit_project"
require "#{BASE}/pit_task"
@@ -33,10 +43,10 @@ class PitTestRunner
`#{@pit} init -f`
end
include Pit::Date
include Pit::Project
include Pit::Task
include Pit::Note
include PitTest::Date
include PitTest::Project
include PitTest::Task
include PitTest::Note
end
PitTestRunner.run

View File

@@ -1,10 +1,17 @@
class Hand < RuntimeError
def oops(msg)
puts "\n#{msg} in #{self.backtrace[1].sub(':', ' line ')}"
end
end
# Copyright (c) 2010 Michael Dvorkin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
class String
# I am well aware there is Test::Unit, minitest, rspec, shoulda,
# bacon and a dozen of other testing frameworks. I just had fun
# writing this one and frankly that's all I need for basic testing.
module TinyShould
def should
def self.equal(expected)
raise Hand unless self == expected
@@ -42,6 +49,16 @@ class String
end
end
class Hand < RuntimeError
def oops(msg)
puts "\n#{msg} in #{self.backtrace[1].sub(':', ' line ')}"
end
end
class String
include TinyShould
end
if $0 == __FILE__
"123".should.equal "123"
"123".should.equal "321"
@@ -55,5 +72,3 @@ if $0 == __FILE__
"abc".should_not.match /xyz/
"abc".should_not.match /abc/
end