doc changes and renamed a file

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@82 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
This commit is contained in:
tsaleh 2007-04-06 14:28:27 +00:00
parent aabc89c561
commit 7910643c6f
3 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@ end
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "ThoughtBot Test Helpers -- Making your tests easy on the fingers and eyes"
rdoc.title = "Shoulda -- Making your tests easy on the fingers and eyes"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.rdoc_files.include('README', 'lib/**/*.rb')

View File

@ -9,7 +9,7 @@ require 'test/unit/ui/console/testrunner'
# every rake task, as though there was another (empty) set of tests.
# A fix would be most welcome.
#
module Color
module ThoughtBot::Shoulda::Color
COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33 } # :nodoc:
def self.method_missing(color_name, *args) # :nodoc:
color(color_name) + args.first + color(:clear)
@ -25,7 +25,7 @@ module Test # :nodoc:
alias :old_to_s :to_s
def to_s
if old_to_s =~ /\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
Color.send($1.to_i != 0 || $2.to_i != 0 ? :red : :green, $&)
ThoughtBot::Shoulda::Color.send($1.to_i != 0 || $2.to_i != 0 ? :red : :green, $&)
end
end
end
@ -43,16 +43,16 @@ module Test # :nodoc:
class Failure # :nodoc:
alias :old_long_display :long_display
def long_display
# old_long_display.sub('Failure', Color.red('Failure'))
Color.red(old_long_display)
# old_long_display.sub('Failure', ThoughtBot::Shoulda::Color.red('Failure'))
ThoughtBot::Shoulda::Color.red(old_long_display)
end
end
class Error # :nodoc:
alias :old_long_display :long_display
def long_display
# old_long_display.sub('Error', Color.yellow('Error'))
Color.yellow(old_long_display)
# old_long_display.sub('Error', ThoughtBot::Shoulda::Color.yellow('Error'))
ThoughtBot::Shoulda::Color.yellow(old_long_display)
end
end
@ -62,9 +62,9 @@ module Test # :nodoc:
def output_single(something, level=NORMAL)
return unless (output?(level))
something = case something
when '.' then Color.green('.')
when 'F' then Color.red("F")
when 'E' then Color.yellow("E")
when '.' then ThoughtBot::Shoulda::Color.green('.')
when 'F' then ThoughtBot::Shoulda::Color.red("F")
when 'E' then ThoughtBot::Shoulda::Color.yellow("E")
else something
end
@io.write(something)

View File

@ -11,7 +11,7 @@ require 'color' if tb_test_options[:color]
module Test # :nodoc:
module Unit # :nodoc:
class TestCase
class TestCase # :nodoc:
include ThoughtBot::Shoulda::General::InstanceMethods