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:
parent
aabc89c561
commit
7910643c6f
2
Rakefile
2
Rakefile
|
@ -12,7 +12,7 @@ end
|
||||||
|
|
||||||
Rake::RDocTask.new { |rdoc|
|
Rake::RDocTask.new { |rdoc|
|
||||||
rdoc.rdoc_dir = 'doc'
|
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.options << '--line-numbers' << '--inline-source'
|
||||||
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
||||||
rdoc.rdoc_files.include('README', 'lib/**/*.rb')
|
rdoc.rdoc_files.include('README', 'lib/**/*.rb')
|
||||||
|
|
18
lib/color.rb
18
lib/color.rb
|
@ -9,7 +9,7 @@ require 'test/unit/ui/console/testrunner'
|
||||||
# every rake task, as though there was another (empty) set of tests.
|
# every rake task, as though there was another (empty) set of tests.
|
||||||
# A fix would be most welcome.
|
# A fix would be most welcome.
|
||||||
#
|
#
|
||||||
module Color
|
module ThoughtBot::Shoulda::Color
|
||||||
COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33 } # :nodoc:
|
COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33 } # :nodoc:
|
||||||
def self.method_missing(color_name, *args) # :nodoc:
|
def self.method_missing(color_name, *args) # :nodoc:
|
||||||
color(color_name) + args.first + color(:clear)
|
color(color_name) + args.first + color(:clear)
|
||||||
|
@ -25,7 +25,7 @@ module Test # :nodoc:
|
||||||
alias :old_to_s :to_s
|
alias :old_to_s :to_s
|
||||||
def to_s
|
def to_s
|
||||||
if old_to_s =~ /\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -43,16 +43,16 @@ module Test # :nodoc:
|
||||||
class Failure # :nodoc:
|
class Failure # :nodoc:
|
||||||
alias :old_long_display :long_display
|
alias :old_long_display :long_display
|
||||||
def long_display
|
def long_display
|
||||||
# old_long_display.sub('Failure', Color.red('Failure'))
|
# old_long_display.sub('Failure', ThoughtBot::Shoulda::Color.red('Failure'))
|
||||||
Color.red(old_long_display)
|
ThoughtBot::Shoulda::Color.red(old_long_display)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Error # :nodoc:
|
class Error # :nodoc:
|
||||||
alias :old_long_display :long_display
|
alias :old_long_display :long_display
|
||||||
def long_display
|
def long_display
|
||||||
# old_long_display.sub('Error', Color.yellow('Error'))
|
# old_long_display.sub('Error', ThoughtBot::Shoulda::Color.yellow('Error'))
|
||||||
Color.yellow(old_long_display)
|
ThoughtBot::Shoulda::Color.yellow(old_long_display)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,9 +62,9 @@ module Test # :nodoc:
|
||||||
def output_single(something, level=NORMAL)
|
def output_single(something, level=NORMAL)
|
||||||
return unless (output?(level))
|
return unless (output?(level))
|
||||||
something = case something
|
something = case something
|
||||||
when '.' then Color.green('.')
|
when '.' then ThoughtBot::Shoulda::Color.green('.')
|
||||||
when 'F' then Color.red("F")
|
when 'F' then ThoughtBot::Shoulda::Color.red("F")
|
||||||
when 'E' then Color.yellow("E")
|
when 'E' then ThoughtBot::Shoulda::Color.yellow("E")
|
||||||
else something
|
else something
|
||||||
end
|
end
|
||||||
@io.write(something)
|
@io.write(something)
|
||||||
|
|
|
@ -11,7 +11,7 @@ require 'color' if tb_test_options[:color]
|
||||||
|
|
||||||
module Test # :nodoc:
|
module Test # :nodoc:
|
||||||
module Unit # :nodoc:
|
module Unit # :nodoc:
|
||||||
class TestCase
|
class TestCase # :nodoc:
|
||||||
|
|
||||||
include ThoughtBot::Shoulda::General::InstanceMethods
|
include ThoughtBot::Shoulda::General::InstanceMethods
|
||||||
|
|
Loading…
Reference in New Issue