Permalink
Showing with 235 additions and 235 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 autotest/discover.rb
  3. +1 −1 lib/autotest/rspec2.rb
  4. +12 −12 lib/rspec/core/configuration.rb
  5. +5 −5 lib/rspec/core/configuration_options.rb
  6. +6 −6 lib/rspec/core/deprecation.rb
  7. +1 −1 lib/rspec/core/errors.rb
  8. +2 −2 lib/rspec/core/example.rb
  9. +2 −2 lib/rspec/core/example_group.rb
  10. +1 −1 lib/rspec/core/formatters/base_formatter.rb
  11. +4 −4 lib/rspec/core/formatters/base_text_formatter.rb
  12. +1 −1 lib/rspec/core/formatters/documentation_formatter.rb
  13. +6 −6 lib/rspec/core/formatters/helpers.rb
  14. +9 −9 lib/rspec/core/formatters/html_formatter.rb
  15. +5 −5 lib/rspec/core/formatters/snippet_extractor.rb
  16. +3 −3 lib/rspec/core/hooks.rb
  17. +5 −5 lib/rspec/core/let.rb
  18. +2 −2 lib/rspec/core/metadata.rb
  19. +2 −2 lib/rspec/core/mocking/with_mocha.rb
  20. +3 −3 lib/rspec/core/option_parser.rb
  21. +1 −1 lib/rspec/core/ruby_project.rb
  22. +2 −2 lib/rspec/core/shared_example_group.rb
  23. +3 −3 lib/rspec/core/world.rb
  24. +14 −14 spec/autotest/rspec_spec.rb
  25. +5 −5 spec/rspec/core/command_line_spec.rb
  26. +20 −20 spec/rspec/core/configuration_options_spec.rb
  27. +9 −9 spec/rspec/core/configuration_spec.rb
  28. +8 −8 spec/rspec/core/core_spec.rb
  29. +10 −10 spec/rspec/core/drb_command_line_spec.rb
  30. +1 −1 spec/rspec/core/example_group_spec.rb
  31. +3 −3 spec/rspec/core/formatters/base_formatter_spec.rb
  32. +1 −1 spec/rspec/core/formatters/base_text_formatter_spec.rb
  33. +1 −1 spec/rspec/core/formatters/documentation_formatter_spec.rb
  34. +2 −2 spec/rspec/core/formatters/helpers_spec.rb
  35. +1 −1 spec/rspec/core/formatters/html_formatted-1.8.7.html
  36. +1 −1 spec/rspec/core/formatters/html_formatted-1.9.1.html
  37. +1 −1 spec/rspec/core/formatters/html_formatted-1.9.2.html
  38. +5 −5 spec/rspec/core/formatters/progress_formatter_spec.rb
  39. +13 −13 spec/rspec/core/formatters/text_mate_formatted-1.8.7.html
  40. +1 −1 spec/rspec/core/formatters/text_mate_formatted-1.9.2.html
  41. +1 −1 spec/rspec/core/let_spec.rb
  42. +9 −9 spec/rspec/core/metadata_spec.rb
  43. +3 −3 spec/rspec/core/option_parser_spec.rb
  44. +1 −1 spec/rspec/core/pending_example_spec.rb
  45. +1 −1 spec/rspec/core/resources/custom_example_group_runner.rb
  46. +4 −4 spec/rspec/core/runner_spec.rb
  47. +4 −4 spec/rspec/core/subject_spec.rb
  48. +38 −38 spec/rspec/core/world_spec.rb
View
@@ -31,7 +31,7 @@ begin
#{"*"*50}
Thank you for installing #{gem.summary}
-
+
#{"*"*50}
EOM
end
View
@@ -1,2 +1,2 @@
Autotest.add_discovery { "rspec2" }
-
+
View
@@ -17,7 +17,7 @@
class RSpecCommandError < StandardError; end
class Autotest::Rspec2 < Autotest
-
+
SPEC_PROGRAM = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'rspec'))
def initialize
@@ -33,10 +33,10 @@ def self.add_setting(name, opts={})
add_setting :include_or_extend_modules, :default => []
add_setting :formatter_class, :default => RSpec::Core::Formatters::ProgressFormatter
add_setting :backtrace_clean_patterns, :default => [
- /\/lib\/ruby\//,
- /bin\/rcov:/,
- /vendor\/rails/,
- /bin\/rspec/,
+ /\/lib\/ruby\//,
+ /bin\/rcov:/,
+ /vendor\/rails/,
+ /bin\/rspec/,
/bin\/spec/,
/lib\/rspec\/(core|expectations|matchers|mocks)/
]
@@ -46,7 +46,7 @@ def self.add_setting(name, opts={})
# add_setting(:name, :default => "default_value")
# add_setting(:name, :alias => :other_setting)
#
- # Use this to add custom settings to the RSpec.configuration object.
+ # Use this to add custom settings to the RSpec.configuration object.
#
# RSpec.configuration.add_setting :foo
#
@@ -66,7 +66,7 @@ def self.add_setting(name, opts={})
# end
#
# == Options
- #
+ #
# +add_setting+ takes an optional hash that supports the following
# keys:
#
@@ -115,7 +115,7 @@ def require_mock_framework_adapter
'rspec/core/mocking/with_flexmock'
else
'rspec/core/mocking/with_absolutely_nothing'
- end
+ end
end
def full_backtrace=(bool)
@@ -171,7 +171,7 @@ def line_number=(line_number)
def full_description=(description)
filter_run :full_description => /#{description}/
end
-
+
def formatter=(formatter_to_use)
if string_const?(formatter_to_use) && (class_name = eval(formatter_to_use)).is_a?(Class)
formatter_class = class_name
@@ -185,19 +185,19 @@ def formatter=(formatter_to_use)
RSpec::Core::Formatters::HtmlFormatter
when 't', 'textmate'
RSpec::Core::Formatters::TextMateFormatter
- when 'progress'
+ when 'progress'
RSpec::Core::Formatters::ProgressFormatter
- else
+ else
raise ArgumentError, "Formatter '#{formatter_to_use}' unknown - maybe you meant 'documentation' or 'progress'?."
end
end
self.formatter_class = formatter_class
end
-
+
def string_const?(str)
str.is_a?(String) && /\A[A-Z][a-zA-Z0-9_:]*\z/ =~ str
end
-
+
def formatter
@formatter ||= formatter_class.new(output)
end
@@ -7,13 +7,13 @@ module Core
class ConfigurationOptions
LOCAL_OPTIONS_FILE = ".rspec"
GLOBAL_OPTIONS_FILE = File.join(File.expand_path("~"), ".rspec")
-
+
attr_reader :options
-
+
def initialize(args)
@args = args
end
-
+
def configure(config)
keys = options.keys
keys.unshift(:requires) if keys.delete(:requires)
@@ -22,7 +22,7 @@ def configure(config)
config.send("#{key}=", options[key])
end
end
-
+
def drb_argv
argv = []
argv << "--color" if options[:color_enabled]
@@ -73,7 +73,7 @@ def parse_local_options(options)
def parse_global_options
parse_options_file(GLOBAL_OPTIONS_FILE)
end
-
+
def parse_options_file(path)
Parser.parse(args_from_options_file(path))
end
@@ -1,8 +1,8 @@
module RSpec
-
+
class << self
def deprecate(method, alternate_method=nil, version=nil)
- version_string = version ? "rspec-#{version}" : "a future version of RSpec"
+ version_string = version ? "rspec-#{version}" : "a future version of RSpec"
message = <<-NOTICE
@@ -30,16 +30,16 @@ def warn_deprecation(message)
end
class HashWithDeprecationNotice < Hash
-
+
def initialize(method, alternate_method=nil, &block)
@method, @alternate_method = method, alternate_method
end
-
+
def []=(k,v)
RSpec.deprecate(@method, @alternate_method)
super
end
-
+
end
-
+
end
View
@@ -5,7 +5,7 @@ module Core
superclass = ['Test::Unit::AssertionFailedError', '::StandardError'].map do |c|
eval(c) rescue nil
end.compact.first
-
+
class PendingExampleFixedError < superclass
end
end
@@ -44,7 +44,7 @@ def run(example_group_instance, reporter)
begin
run_before_each
@in_block = true
- with_pending_capture &@example_block
+ with_pending_capture &@example_block
rescue Exception => e
set_exception(e)
ensure
@@ -127,7 +127,7 @@ def run_after_each
def assign_auto_description
if description.empty?
- metadata[:description] = RSpec::Matchers.generated_description
+ metadata[:description] = RSpec::Matchers.generated_description
RSpec::Matchers.clear_generated_description
end
end
@@ -94,7 +94,7 @@ def self.descendant_filtered_examples
end
def self.metadata
- @metadata
+ @metadata
end
def self.superclass_metadata
@@ -123,7 +123,7 @@ class << self
def self.subclass(parent, args, &example_group_block)
subclass = Class.new(parent)
- subclass.set_it_up(*args)
+ subclass.set_it_up(*args)
subclass.module_eval(&example_group_block) if example_group_block
subclass
end
@@ -118,7 +118,7 @@ def format_backtrace(backtrace, example)
cleansed = backtrace.select { |line| backtrace_line(line) }
# Kick the describe stack info off the list, just keep the line the problem happened on from that file
- # cleansed = [cleansed.detect { |line| line.split(':').first == example.metadata[:caller].split(':').first }] if cleansed.size > 1
+ # cleansed = [cleansed.detect { |line| line.split(':').first == example.metadata[:caller].split(':').first }] if cleansed.size > 1
cleansed.empty? ? backtrace : cleansed
end
@@ -28,7 +28,7 @@ def dump_failures
output.puts grey("#{padding}# #{backtrace_info}")
end
- output.puts
+ output.puts
end
end
@@ -43,7 +43,7 @@ def colorise_summary(summary)
red(summary)
end
end
-
+
def dump_summary
output.puts "\nFinished in #{format_seconds(duration)} seconds\n"
@@ -52,7 +52,7 @@ def dump_summary
# Don't print out profiled info if there are failures, it just clutters the output
if profile_examples? && failure_count == 0
sorted_examples = examples.sort_by { |example| example.execution_result[:run_time] }.reverse.first(10)
- output.puts "\nTop #{sorted_examples.size} slowest examples:\n"
+ output.puts "\nTop #{sorted_examples.size} slowest examples:\n"
sorted_examples.each do |example|
output.puts " (#{format_seconds(example.execution_result[:run_time])} seconds) #{example}"
output.puts grey(" # #{format_caller(example.metadata[:location])}")
@@ -63,7 +63,7 @@ def dump_summary
def summary_line(example_count, failure_count, pending_count)
summary = pluralize(example_count, "example")
summary << ", " << pluralize(failure_count, "failure")
- summary << ", #{pending_count} pending" if pending_count > 0
+ summary << ", #{pending_count} pending" if pending_count > 0
summary
end
@@ -21,7 +21,7 @@ def add_example_group(example_group)
@previous_nested_example_groups = example_group_chain
end
-
+
def example_passed(example)
super
output.puts passed_output(example)
@@ -7,22 +7,22 @@ module Formatters
module Helpers
SUB_SECOND_PRECISION = 5
DEFAULT_PRECISION = 2
-
+
def format_seconds(float)
precision ||= (float < 1) ? SUB_SECOND_PRECISION : DEFAULT_PRECISION
formatted = sprintf("%.#{precision}f", float)
strip_trailing_zeroes(formatted)
end
-
+
def strip_trailing_zeroes(string)
stripped = string.sub(/[^1-9]+$/, '')
stripped.empty? ? "0" : stripped
end
-
+
end
-
+
end
-
+
end
-
+
end
@@ -13,24 +13,24 @@ def method_missing(m, *a, &b)
def message(message)
end
-
+
def initialize(output)
super
@example_group_number = 0
@example_number = 0
@header_red = nil
end
-
+
# The number of the currently running example_group
def example_group_number
@example_group_number
end
-
+
# The number of the currently running example (a global counter)
def example_number
@example_number
end
-
+
def start(example_count)
super
@output.puts html_header
@@ -108,7 +108,7 @@ def extra_failure_content(exception)
@snippet_extractor ||= SnippetExtractor.new
" <pre class=\"ruby\"><code>#{@snippet_extractor.snippet(exception)}</code></pre>"
end
-
+
def move_progress
@output.puts " <script type=\"text/javascript\">moveProgressBar('#{percent_done}');</script>"
@output.flush
@@ -133,7 +133,7 @@ def dump_summary
totals = "This was a dry-run"
else
totals = "#{example_count} example#{'s' unless example_count == 1}, #{failure_count} failure#{'s' unless failure_count == 1}"
- totals << ", #{pending_count} pending" if pending_count > 0
+ totals << ", #{pending_count} pending" if pending_count > 0
end
@output.puts "<script type=\"text/javascript\">document.getElementById('duration').innerHTML = \"Finished in <strong>#{duration} seconds</strong>\";</script>"
@output.puts "<script type=\"text/javascript\">document.getElementById('totals').innerHTML = \"#{totals}\";</script>"
@@ -144,10 +144,10 @@ def dump_summary
@output.flush
end
- def html_header
+ def html_header
<<-EOF
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
+<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -220,7 +220,7 @@ def global_scripts
}
EOF
end
-
+
def global_styles
<<-EOF
#rspec-header {
Oops, something went wrong.

0 comments on commit 65bbb80

Please sign in to comment.