rspec 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/{CHANGES → History.txt} +116 -64
  2. data/Manifest.txt +403 -0
  3. data/{MIT-LICENSE → README.txt} +43 -0
  4. data/Rakefile +39 -212
  5. data/{TODO → TODO.txt} +0 -0
  6. data/bin/autospec +4 -0
  7. data/bin/spec +1 -1
  8. data/examples/pure/yielding_example.rb +33 -0
  9. data/examples/stories/game-of-life/.loadpath +5 -0
  10. data/examples/stories/game-of-life/behaviour/everything.rb +1 -1
  11. data/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +17 -17
  12. data/init.rb +9 -0
  13. data/lib/autotest/discover.rb +1 -1
  14. data/lib/autotest/rspec.rb +3 -29
  15. data/lib/spec.rb +10 -12
  16. data/lib/spec/adapters.rb +1 -0
  17. data/lib/spec/adapters/ruby_engine.rb +26 -0
  18. data/lib/spec/adapters/ruby_engine/mri.rb +8 -0
  19. data/lib/spec/adapters/ruby_engine/rubinius.rb +8 -0
  20. data/lib/spec/example/errors.rb +6 -0
  21. data/lib/spec/example/example_group_methods.rb +17 -14
  22. data/lib/spec/example/example_matcher.rb +2 -0
  23. data/lib/spec/example/example_methods.rb +4 -9
  24. data/lib/spec/example/module_inclusion_warnings.rb +2 -1
  25. data/lib/spec/expectations/extensions/object.rb +2 -2
  26. data/lib/spec/expectations/handler.rb +8 -16
  27. data/lib/spec/extensions/main.rb +2 -17
  28. data/lib/spec/matchers.rb +8 -2
  29. data/lib/spec/matchers/be.rb +0 -3
  30. data/lib/spec/matchers/change.rb +44 -40
  31. data/lib/spec/matchers/has.rb +1 -1
  32. data/lib/spec/matchers/have.rb +17 -12
  33. data/lib/spec/matchers/operator_matcher.rb +10 -4
  34. data/lib/spec/matchers/simple_matcher.rb +113 -10
  35. data/lib/spec/mocks.rb +1 -1
  36. data/lib/spec/mocks/argument_constraints.rb +185 -0
  37. data/lib/spec/mocks/argument_expectation.rb +35 -173
  38. data/lib/spec/mocks/framework.rb +1 -1
  39. data/lib/spec/mocks/message_expectation.rb +30 -5
  40. data/lib/spec/mocks/methods.rb +14 -2
  41. data/lib/spec/mocks/mock.rb +4 -0
  42. data/lib/spec/mocks/proxy.rb +46 -5
  43. data/lib/spec/mocks/spec_methods.rb +9 -1
  44. data/lib/spec/rake/spectask.rb +14 -22
  45. data/lib/spec/rake/verify_rcov.rb +3 -3
  46. data/lib/spec/runner.rb +18 -6
  47. data/lib/spec/runner/backtrace_tweaker.rb +6 -7
  48. data/lib/spec/runner/command_line.rb +6 -17
  49. data/lib/spec/runner/drb_command_line.rb +1 -1
  50. data/lib/spec/runner/formatter/base_formatter.rb +3 -1
  51. data/lib/spec/runner/formatter/base_text_formatter.rb +5 -9
  52. data/lib/spec/runner/formatter/html_formatter.rb +1 -1
  53. data/lib/spec/runner/formatter/nested_text_formatter.rb +1 -1
  54. data/lib/spec/runner/formatter/progress_bar_formatter.rb +2 -2
  55. data/lib/spec/runner/formatter/specdoc_formatter.rb +1 -1
  56. data/lib/spec/runner/formatter/story/html_formatter.rb +62 -16
  57. data/lib/spec/runner/formatter/story/plain_text_formatter.rb +68 -16
  58. data/lib/spec/runner/formatter/story/progress_bar_formatter.rb +42 -0
  59. data/lib/spec/runner/heckle_runner.rb +2 -2
  60. data/lib/spec/runner/option_parser.rb +2 -1
  61. data/lib/spec/runner/options.rb +18 -9
  62. data/lib/spec/runner/reporter.rb +24 -4
  63. data/lib/spec/runner/spec_parser.rb +1 -1
  64. data/lib/spec/story/runner.rb +1 -2
  65. data/lib/spec/story/runner/story_mediator.rb +14 -0
  66. data/lib/spec/story/runner/story_parser.rb +20 -0
  67. data/lib/spec/story/step.rb +40 -28
  68. data/lib/spec/story/step_mother.rb +2 -1
  69. data/lib/spec/story/world.rb +6 -2
  70. data/lib/spec/version.rb +13 -22
  71. data/rake_tasks/failing_examples_with_html.rake +1 -1
  72. data/rake_tasks/verify_rcov.rake +2 -2
  73. data/rspec.gemspec +33 -0
  74. data/spec/autotest/rspec_spec.rb +90 -141
  75. data/spec/spec/adapters/ruby_engine_spec.rb +16 -0
  76. data/spec/spec/example/base_formatter_spec.rb +112 -0
  77. data/spec/spec/example/example_group_factory_spec.rb +2 -2
  78. data/spec/spec/example/example_group_methods_spec.rb +55 -4
  79. data/spec/spec/example/example_group_spec.rb +4 -3
  80. data/spec/spec/example/example_methods_spec.rb +18 -14
  81. data/spec/spec/example/pending_module_spec.rb +38 -0
  82. data/spec/spec/example/shared_example_group_spec.rb +1 -1
  83. data/spec/spec/expectations/extensions/object_spec.rb +0 -12
  84. data/spec/spec/extensions/main_spec.rb +3 -8
  85. data/spec/spec/matchers/change_spec.rb +16 -6
  86. data/spec/spec/matchers/handler_spec.rb +58 -37
  87. data/spec/spec/matchers/has_spec.rb +10 -0
  88. data/spec/spec/matchers/have_spec.rb +105 -2
  89. data/spec/spec/matchers/operator_matcher_spec.rb +35 -2
  90. data/spec/spec/matchers/simple_matcher_spec.rb +64 -2
  91. data/spec/spec/mocks/any_number_of_times_spec.rb +7 -0
  92. data/spec/spec/mocks/bug_report_496.rb +17 -0
  93. data/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +7 -1
  94. data/spec/spec/mocks/hash_including_matcher_spec.rb +45 -24
  95. data/spec/spec/mocks/mock_spec.rb +55 -10
  96. data/spec/spec/mocks/nil_expectation_warning_spec.rb +54 -0
  97. data/spec/spec/mocks/null_object_mock_spec.rb +14 -0
  98. data/spec/spec/mocks/options_hash_spec.rb +18 -28
  99. data/spec/spec/mocks/partial_mock_spec.rb +2 -0
  100. data/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +20 -6
  101. data/spec/spec/mocks/stub_spec.rb +7 -0
  102. data/spec/spec/runner/command_line_spec.rb +5 -12
  103. data/spec/spec/runner/drb_command_line_spec.rb +13 -6
  104. data/spec/spec/runner/formatter/html_formatter_spec.rb +2 -1
  105. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +3 -3
  106. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +20 -2
  107. data/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +2 -1
  108. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +3 -3
  109. data/spec/spec/runner/formatter/story/html_formatter_spec.rb +76 -2
  110. data/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +161 -0
  111. data/spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb +82 -0
  112. data/spec/spec/runner/heckle_runner_spec.rb +8 -8
  113. data/spec/spec/runner/option_parser_spec.rb +21 -6
  114. data/spec/spec/runner/output_one_time_fixture_runner.rb +1 -1
  115. data/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +6 -0
  116. data/spec/spec/runner/reporter_spec.rb +51 -5
  117. data/spec/spec/runner/spec_parser_spec.rb +4 -4
  118. data/spec/spec/story/runner/plain_text_story_runner_spec.rb +2 -5
  119. data/spec/spec/story/runner/story_mediator_spec.rb +10 -0
  120. data/spec/spec/story/runner/story_parser_spec.rb +23 -6
  121. data/spec/spec/story/scenario_spec.rb +1 -3
  122. data/spec/spec/story/step_mother_spec.rb +12 -0
  123. data/spec/spec/story/step_spec.rb +57 -4
  124. data/spec/spec/story/story_spec.rb +1 -3
  125. data/spec/spec/story/world_spec.rb +1 -1
  126. data/spec/spec_helper.rb +21 -68
  127. data/stories/all.rb +1 -1
  128. data/stories/configuration/before_blocks.story +21 -0
  129. data/stories/configuration/stories.rb +7 -0
  130. data/stories/example_groups/stories.rb +3 -4
  131. data/stories/resources/spec/before_blocks_example.rb +32 -0
  132. data/stories/stories/multiline_steps.story +23 -0
  133. data/stories/stories/steps/multiline_steps.rb +13 -0
  134. data/stories/stories/stories.rb +6 -0
  135. data/story_server/prototype/javascripts/builder.js +136 -0
  136. data/story_server/prototype/javascripts/controls.js +972 -0
  137. data/story_server/prototype/javascripts/dragdrop.js +976 -0
  138. data/story_server/prototype/javascripts/effects.js +1117 -0
  139. data/story_server/prototype/javascripts/prototype.js +4140 -0
  140. data/story_server/prototype/javascripts/rspec.js +149 -0
  141. data/story_server/prototype/javascripts/scriptaculous.js +58 -0
  142. data/story_server/prototype/javascripts/slider.js +276 -0
  143. data/story_server/prototype/javascripts/sound.js +55 -0
  144. data/story_server/prototype/javascripts/unittest.js +568 -0
  145. data/story_server/prototype/lib/server.rb +24 -0
  146. data/story_server/prototype/stories.html +176 -0
  147. data/story_server/prototype/stylesheets/rspec.css +136 -0
  148. data/story_server/prototype/stylesheets/test.css +90 -0
  149. metadata +166 -166
  150. data/README +0 -36
  151. data/UPGRADE +0 -7
  152. data/bin/spec_translator +0 -8
  153. data/lib/spec/mocks/argument_constraint_matchers.rb +0 -31
  154. data/lib/spec/translator.rb +0 -114
  155. data/spec/spec/example/example_spec.rb +0 -53
  156. data/spec/spec/runner/execution_context_spec.rb +0 -37
  157. data/spec/spec/translator_spec.rb +0 -265
@@ -5,53 +5,65 @@ module Spec
5
5
  PARAM_OR_GROUP_PATTERN = /(\$(?!\$)\w*)|\(.*?\)/
6
6
 
7
7
  attr_reader :name
8
+
8
9
  def initialize(name, &block)
9
- @name = name
10
- assign_expression(name)
11
- init_module(name, &block)
10
+ init_name(name)
11
+ init_expression(name)
12
+ block_given? ? init_module(name, &block) : set_pending
12
13
  end
13
14
 
14
15
  def perform(instance, *args)
16
+ raise Spec::Example::ExamplePendingError.new("Not Yet Implemented") if pending?
15
17
  instance.extend(@mod)
16
18
  instance.__send__(sanitize(@name), *args)
17
19
  end
18
20
 
19
- def init_module(name, &block)
20
- sanitized_name = sanitize(name)
21
- @mod = Module.new do
22
- define_method(sanitized_name, &block)
23
- end
21
+ def matches?(name)
22
+ !(name.strip =~ @expression).nil?
24
23
  end
24
+
25
+ def parse_args(name)
26
+ name.strip.match(@expression)[1..-1]
27
+ end
28
+
29
+ private
25
30
 
26
31
  def sanitize(a_string_or_regexp)
27
32
  return a_string_or_regexp.source if Regexp == a_string_or_regexp
28
33
  a_string_or_regexp.to_s
29
34
  end
30
-
31
35
 
32
- def matches?(name)
33
- !(matches = name.match(@expression)).nil?
36
+ def init_module(name, &block)
37
+ sanitized_name = sanitize(name)
38
+ @mod = Module.new do
39
+ define_method(sanitized_name, &block)
40
+ end
34
41
  end
35
-
36
- def parse_args(name)
37
- name.match(@expression)[1..-1]
42
+
43
+ def set_pending
44
+ @pending = true
45
+ end
46
+
47
+ def pending?
48
+ @pending == true
38
49
  end
39
-
40
- private
41
50
 
42
- def assign_expression(string_or_regexp)
43
- if String === string_or_regexp
44
- expression = string_or_regexp.dup
45
- expression.gsub! '(', '\('
46
- expression.gsub! ')', '\)'
47
- elsif Regexp === string_or_regexp
48
- expression = string_or_regexp.source
49
- end
50
- while expression =~ PARAM_PATTERN
51
- expression.gsub!($2, "(.*?)")
52
- end
53
- @expression = Regexp.new("^#{expression}$")
51
+ def init_name(name)
52
+ @name = name
53
+ end
54
+
55
+ def init_expression(string_or_regexp)
56
+ if String === string_or_regexp
57
+ expression = string_or_regexp.dup
58
+ %w<? ( ) [ ] { } ^ !>.each {|c| expression.gsub! c, "\\#{c}"}
59
+ elsif Regexp === string_or_regexp
60
+ expression = string_or_regexp.source
61
+ end
62
+ while expression =~ PARAM_PATTERN
63
+ expression.sub!($2, "(.*?)")
54
64
  end
65
+ @expression = Regexp.new("\\A#{expression}\\Z", Regexp::MULTILINE)
66
+ end
55
67
 
56
68
  end
57
69
  end
@@ -13,7 +13,8 @@ module Spec
13
13
  @steps.add(type, step)
14
14
  end
15
15
 
16
- def find(type, name)
16
+ def find(type, unstripped_name)
17
+ name = unstripped_name.strip
17
18
  if @steps.find(type, name).nil?
18
19
  @steps.add(type,
19
20
  Step.new(name) do
@@ -48,7 +48,7 @@ module Spec
48
48
  begin
49
49
  listeners.each { |l| l.found_scenario(type, name) }
50
50
  @listeners.clear
51
- scenario.perform(world, name) unless ::Spec::Story::Runner.dry_run
51
+ scenario.perform(world, name) unless dry_run
52
52
  ensure
53
53
  @listeners.replace(current_listeners)
54
54
  end
@@ -70,7 +70,7 @@ module Spec
70
70
  args = step.parse_args(name) if args.empty?
71
71
  begin
72
72
  listeners.each { |l| l.step_upcoming(type, step_name, *args) }
73
- step.perform(world, *args) unless ::Spec::Story::Runner.dry_run
73
+ step.perform(world, *args) unless dry_run
74
74
  listeners.each { |l| l.step_succeeded(type, step_name, *args) }
75
75
  rescue Exception => e
76
76
  case e
@@ -86,6 +86,10 @@ module Spec
86
86
  def errors
87
87
  @errors ||= []
88
88
  end
89
+
90
+ def dry_run
91
+ ::Spec::Story::Runner.dry_run
92
+ end
89
93
  end # end of class << self
90
94
 
91
95
  def start_collecting_errors
@@ -1,22 +1,13 @@
1
- module Spec
2
- module VERSION
3
- unless defined? MAJOR
4
- MAJOR = 1
5
- MINOR = 1
6
- TINY = 4
7
- RELEASE_CANDIDATE = nil
8
-
9
- BUILD_TIME_UTC = 20080526202855
10
-
11
- STRING = [MAJOR, MINOR, TINY].join('.')
12
- TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
13
- FULL_VERSION = "#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('.')} (build #{BUILD_TIME_UTC})"
14
-
15
- NAME = "RSpec"
16
- URL = "http://rspec.rubyforge.org/"
17
-
18
- DESCRIPTION = "#{NAME}-#{FULL_VERSION} - BDD for Ruby\n#{URL}"
19
- end
20
- end
21
- end
22
-
1
+ module Spec
2
+ module VERSION
3
+ unless defined? MAJOR
4
+ MAJOR = 1
5
+ MINOR = 1
6
+ TINY = 5
7
+
8
+ STRING = [MAJOR, MINOR, TINY].join('.')
9
+
10
+ SUMMARY = "rspec version #{STRING}"
11
+ end
12
+ end
13
+ end
@@ -4,6 +4,6 @@ require 'spec/rake/spectask'
4
4
  desc "Generate HTML report for failing examples"
5
5
  Spec::Rake::SpecTask.new('failing_examples_with_html') do |t|
6
6
  t.spec_files = FileList['failing_examples/**/*.rb']
7
- t.spec_opts = ["--format", "html:../doc/output/documentation/tools/failing_examples.html", "--diff"]
7
+ t.spec_opts = ["--format", "html:doc/reports/tools/failing_examples.html", "--diff"]
8
8
  t.fail_on_error = false
9
9
  end
@@ -2,6 +2,6 @@ require 'rake'
2
2
  require 'spec/rake/verify_rcov'
3
3
 
4
4
  RCov::VerifyTask.new(:verify_rcov => :spec) do |t|
5
- t.threshold = 100.0 # Make sure you have rcov 0.7 or higher!
6
- t.index_html = '../doc/output/coverage/index.html'
5
+ t.threshold = 100.0
6
+ t.index_html = 'coverage/index.html'
7
7
  end
@@ -0,0 +1,33 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{rspec}
3
+ s.version = "1.1.5"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["RSpec Development Team"]
7
+ s.date = %q{2008-09-28}
8
+ s.description = %q{Behaviour Driven Development for Ruby.}
9
+ s.email = ["rspec-devel@rubyforge.org"]
10
+ s.executables = ["autospec", "spec"]
11
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt", "TODO.txt", "examples/pure/priority.txt", "examples/stories/game-of-life/README.txt", "examples/stories/game-of-life/behaviour/stories/stories.txt", "failing_examples/README.txt", "spec/spec/runner/empty_file.txt", "spec/spec/runner/examples.txt", "spec/spec/runner/failed.txt"]
12
+ s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "TODO.txt", "bin/autospec", "bin/spec", "examples/pure/autogenerated_docstrings_example.rb", "examples/pure/before_and_after_example.rb", "examples/pure/behave_as_example.rb", "examples/pure/custom_expectation_matchers.rb", "examples/pure/custom_formatter.rb", "examples/pure/dynamic_spec.rb", "examples/pure/file_accessor.rb", "examples/pure/file_accessor_spec.rb", "examples/pure/greeter_spec.rb", "examples/pure/helper_method_example.rb", "examples/pure/io_processor.rb", "examples/pure/io_processor_spec.rb", "examples/pure/legacy_spec.rb", "examples/pure/mocking_example.rb", "examples/pure/multi_threaded_behaviour_runner.rb", "examples/pure/nested_classes_example.rb", "examples/pure/partial_mock_example.rb", "examples/pure/pending_example.rb", "examples/pure/predicate_example.rb", "examples/pure/priority.txt", "examples/pure/shared_example_group_example.rb", "examples/pure/shared_stack_examples.rb", "examples/pure/spec_helper.rb", "examples/pure/stack.rb", "examples/pure/stack_spec.rb", "examples/pure/stack_spec_with_nested_example_groups.rb", "examples/pure/stubbing_example.rb", "examples/pure/yielding_example.rb", "examples/stories/adder.rb", "examples/stories/addition", "examples/stories/addition.rb", "examples/stories/calculator.rb", "examples/stories/game-of-life/.loadpath", "examples/stories/game-of-life/README.txt", "examples/stories/game-of-life/behaviour/everything.rb", "examples/stories/game-of-life/behaviour/examples/examples.rb", "examples/stories/game-of-life/behaviour/examples/game_behaviour.rb", "examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb", "examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story", "examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story", "examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story", "examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story", "examples/stories/game-of-life/behaviour/stories/ICanKillACell.story", "examples/stories/game-of-life/behaviour/stories/TheGridWraps.story", "examples/stories/game-of-life/behaviour/stories/create_a_cell.rb", "examples/stories/game-of-life/behaviour/stories/helper.rb", "examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb", "examples/stories/game-of-life/behaviour/stories/steps.rb", "examples/stories/game-of-life/behaviour/stories/stories.rb", "examples/stories/game-of-life/behaviour/stories/stories.txt", "examples/stories/game-of-life/life.rb", "examples/stories/game-of-life/life/game.rb", "examples/stories/game-of-life/life/grid.rb", "examples/stories/helper.rb", "examples/stories/steps/addition_steps.rb", "failing_examples/README.txt", "failing_examples/diffing_spec.rb", "failing_examples/failing_autogenerated_docstrings_example.rb", "failing_examples/failure_in_setup.rb", "failing_examples/failure_in_teardown.rb", "failing_examples/mocking_example.rb", "failing_examples/mocking_with_flexmock.rb", "failing_examples/mocking_with_mocha.rb", "failing_examples/mocking_with_rr.rb", "failing_examples/partial_mock_example.rb", "failing_examples/predicate_example.rb", "failing_examples/raising_example.rb", "failing_examples/spec_helper.rb", "failing_examples/syntax_error_example.rb", "failing_examples/team_spec.rb", "failing_examples/timeout_behaviour.rb", "init.rb", "lib/autotest/discover.rb", "lib/autotest/rspec.rb", "lib/spec.rb", "lib/spec/adapters.rb", "lib/spec/adapters/ruby_engine.rb", "lib/spec/adapters/ruby_engine/mri.rb", "lib/spec/adapters/ruby_engine/rubinius.rb", "lib/spec/example.rb", "lib/spec/example/configuration.rb", "lib/spec/example/errors.rb", "lib/spec/example/example_group.rb", "lib/spec/example/example_group_factory.rb", "lib/spec/example/example_group_methods.rb", "lib/spec/example/example_matcher.rb", "lib/spec/example/example_methods.rb", "lib/spec/example/module_inclusion_warnings.rb", "lib/spec/example/module_reopening_fix.rb", "lib/spec/example/pending.rb", "lib/spec/example/shared_example_group.rb", "lib/spec/expectations.rb", "lib/spec/expectations/differs/default.rb", "lib/spec/expectations/errors.rb", "lib/spec/expectations/extensions.rb", "lib/spec/expectations/extensions/object.rb", "lib/spec/expectations/extensions/string_and_symbol.rb", "lib/spec/expectations/handler.rb", "lib/spec/extensions.rb", "lib/spec/extensions/class.rb", "lib/spec/extensions/main.rb", "lib/spec/extensions/metaclass.rb", "lib/spec/extensions/object.rb", "lib/spec/interop/test.rb", "lib/spec/interop/test/unit/autorunner.rb", "lib/spec/interop/test/unit/testcase.rb", "lib/spec/interop/test/unit/testresult.rb", "lib/spec/interop/test/unit/testsuite_adapter.rb", "lib/spec/interop/test/unit/ui/console/testrunner.rb", "lib/spec/matchers.rb", "lib/spec/matchers/be.rb", "lib/spec/matchers/be_close.rb", "lib/spec/matchers/change.rb", "lib/spec/matchers/eql.rb", "lib/spec/matchers/equal.rb", "lib/spec/matchers/exist.rb", "lib/spec/matchers/has.rb", "lib/spec/matchers/have.rb", "lib/spec/matchers/include.rb", "lib/spec/matchers/match.rb", "lib/spec/matchers/operator_matcher.rb", "lib/spec/matchers/raise_error.rb", "lib/spec/matchers/respond_to.rb", "lib/spec/matchers/satisfy.rb", "lib/spec/matchers/simple_matcher.rb", "lib/spec/matchers/throw_symbol.rb", "lib/spec/mocks.rb", "lib/spec/mocks/argument_constraints.rb", "lib/spec/mocks/argument_expectation.rb", "lib/spec/mocks/error_generator.rb", "lib/spec/mocks/errors.rb", "lib/spec/mocks/extensions.rb", "lib/spec/mocks/extensions/object.rb", "lib/spec/mocks/framework.rb", "lib/spec/mocks/message_expectation.rb", "lib/spec/mocks/methods.rb", "lib/spec/mocks/mock.rb", "lib/spec/mocks/order_group.rb", "lib/spec/mocks/proxy.rb", "lib/spec/mocks/space.rb", "lib/spec/mocks/spec_methods.rb", "lib/spec/rake/spectask.rb", "lib/spec/rake/verify_rcov.rb", "lib/spec/runner.rb", "lib/spec/runner/backtrace_tweaker.rb", "lib/spec/runner/class_and_arguments_parser.rb", "lib/spec/runner/command_line.rb", "lib/spec/runner/drb_command_line.rb", "lib/spec/runner/example_group_runner.rb", "lib/spec/runner/formatter/base_formatter.rb", "lib/spec/runner/formatter/base_text_formatter.rb", "lib/spec/runner/formatter/failing_example_groups_formatter.rb", "lib/spec/runner/formatter/failing_examples_formatter.rb", "lib/spec/runner/formatter/html_formatter.rb", "lib/spec/runner/formatter/nested_text_formatter.rb", "lib/spec/runner/formatter/profile_formatter.rb", "lib/spec/runner/formatter/progress_bar_formatter.rb", "lib/spec/runner/formatter/snippet_extractor.rb", "lib/spec/runner/formatter/specdoc_formatter.rb", "lib/spec/runner/formatter/story/html_formatter.rb", "lib/spec/runner/formatter/story/plain_text_formatter.rb", "lib/spec/runner/formatter/story/progress_bar_formatter.rb", "lib/spec/runner/formatter/text_mate_formatter.rb", "lib/spec/runner/heckle_runner.rb", "lib/spec/runner/heckle_runner_unsupported.rb", "lib/spec/runner/option_parser.rb", "lib/spec/runner/options.rb", "lib/spec/runner/reporter.rb", "lib/spec/runner/spec_parser.rb", "lib/spec/story.rb", "lib/spec/story/extensions.rb", "lib/spec/story/extensions/main.rb", "lib/spec/story/extensions/regexp.rb", "lib/spec/story/extensions/string.rb", "lib/spec/story/given_scenario.rb", "lib/spec/story/runner.rb", "lib/spec/story/runner/plain_text_story_runner.rb", "lib/spec/story/runner/scenario_collector.rb", "lib/spec/story/runner/scenario_runner.rb", "lib/spec/story/runner/story_mediator.rb", "lib/spec/story/runner/story_parser.rb", "lib/spec/story/runner/story_runner.rb", "lib/spec/story/scenario.rb", "lib/spec/story/step.rb", "lib/spec/story/step_group.rb", "lib/spec/story/step_mother.rb", "lib/spec/story/story.rb", "lib/spec/story/world.rb", "lib/spec/version.rb", "plugins/mock_frameworks/flexmock.rb", "plugins/mock_frameworks/mocha.rb", "plugins/mock_frameworks/rr.rb", "plugins/mock_frameworks/rspec.rb", "rake_tasks/examples.rake", "rake_tasks/examples_with_rcov.rake", "rake_tasks/failing_examples_with_html.rake", "rake_tasks/verify_rcov.rake", "rspec.gemspec", "spec/README.jruby", "spec/autotest/discover_spec.rb", "spec/autotest/rspec_spec.rb", "spec/autotest_helper.rb", "spec/autotest_matchers.rb", "spec/rspec_suite.rb", "spec/ruby_forker.rb", "spec/spec.opts", "spec/spec/adapters/ruby_engine_spec.rb", "spec/spec/example/base_formatter_spec.rb", "spec/spec/example/configuration_spec.rb", "spec/spec/example/example_group/described_module_spec.rb", "spec/spec/example/example_group/warning_messages_spec.rb", "spec/spec/example/example_group_class_definition_spec.rb", "spec/spec/example/example_group_factory_spec.rb", "spec/spec/example/example_group_methods_spec.rb", "spec/spec/example/example_group_spec.rb", "spec/spec/example/example_matcher_spec.rb", "spec/spec/example/example_methods_spec.rb", "spec/spec/example/example_runner_spec.rb", "spec/spec/example/nested_example_group_spec.rb", "spec/spec/example/pending_module_spec.rb", "spec/spec/example/predicate_matcher_spec.rb", "spec/spec/example/shared_example_group_spec.rb", "spec/spec/example/subclassing_example_group_spec.rb", "spec/spec/expectations/differs/default_spec.rb", "spec/spec/expectations/extensions/object_spec.rb", "spec/spec/expectations/fail_with_spec.rb", "spec/spec/extensions/main_spec.rb", "spec/spec/interop/test/unit/resources/spec_that_fails.rb", "spec/spec/interop/test/unit/resources/spec_that_passes.rb", "spec/spec/interop/test/unit/resources/spec_with_errors.rb", "spec/spec/interop/test/unit/resources/test_case_that_fails.rb", "spec/spec/interop/test/unit/resources/test_case_that_passes.rb", "spec/spec/interop/test/unit/resources/test_case_with_errors.rb", "spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb", "spec/spec/interop/test/unit/spec_spec.rb", "spec/spec/interop/test/unit/test_unit_spec_helper.rb", "spec/spec/interop/test/unit/testcase_spec.rb", "spec/spec/interop/test/unit/testsuite_adapter_spec.rb", "spec/spec/matchers/be_close_spec.rb", "spec/spec/matchers/be_spec.rb", "spec/spec/matchers/change_spec.rb", "spec/spec/matchers/description_generation_spec.rb", "spec/spec/matchers/eql_spec.rb", "spec/spec/matchers/equal_spec.rb", "spec/spec/matchers/exist_spec.rb", "spec/spec/matchers/handler_spec.rb", "spec/spec/matchers/has_spec.rb", "spec/spec/matchers/have_spec.rb", "spec/spec/matchers/include_spec.rb", "spec/spec/matchers/match_spec.rb", "spec/spec/matchers/matcher_methods_spec.rb", "spec/spec/matchers/mock_constraint_matchers_spec.rb", "spec/spec/matchers/operator_matcher_spec.rb", "spec/spec/matchers/raise_error_spec.rb", "spec/spec/matchers/respond_to_spec.rb", "spec/spec/matchers/satisfy_spec.rb", "spec/spec/matchers/simple_matcher_spec.rb", "spec/spec/matchers/throw_symbol_spec.rb", "spec/spec/mocks/any_number_of_times_spec.rb", "spec/spec/mocks/argument_expectation_spec.rb", "spec/spec/mocks/at_least_spec.rb", "spec/spec/mocks/at_most_spec.rb", "spec/spec/mocks/bug_report_10260_spec.rb", "spec/spec/mocks/bug_report_10263_spec.rb", "spec/spec/mocks/bug_report_11545_spec.rb", "spec/spec/mocks/bug_report_15719_spec.rb", "spec/spec/mocks/bug_report_496.rb", "spec/spec/mocks/bug_report_7611_spec.rb", "spec/spec/mocks/bug_report_7805_spec.rb", "spec/spec/mocks/bug_report_8165_spec.rb", "spec/spec/mocks/bug_report_8302_spec.rb", "spec/spec/mocks/failing_mock_argument_constraints_spec.rb", "spec/spec/mocks/hash_including_matcher_spec.rb", "spec/spec/mocks/mock_ordering_spec.rb", "spec/spec/mocks/mock_space_spec.rb", "spec/spec/mocks/mock_spec.rb", "spec/spec/mocks/multiple_return_value_spec.rb", "spec/spec/mocks/nil_expectation_warning_spec.rb", "spec/spec/mocks/null_object_mock_spec.rb", "spec/spec/mocks/once_counts_spec.rb", "spec/spec/mocks/options_hash_spec.rb", "spec/spec/mocks/partial_mock_spec.rb", "spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb", "spec/spec/mocks/passing_mock_argument_constraints_spec.rb", "spec/spec/mocks/precise_counts_spec.rb", "spec/spec/mocks/record_messages_spec.rb", "spec/spec/mocks/stub_spec.rb", "spec/spec/mocks/twice_counts_spec.rb", "spec/spec/package/bin_spec_spec.rb", "spec/spec/runner/class_and_argument_parser_spec.rb", "spec/spec/runner/command_line_spec.rb", "spec/spec/runner/drb_command_line_spec.rb", "spec/spec/runner/empty_file.txt", "spec/spec/runner/examples.txt", "spec/spec/runner/failed.txt", "spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb", "spec/spec/runner/formatter/failing_examples_formatter_spec.rb", "spec/spec/runner/formatter/html_formatted-1.8.4.html", "spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.5.html", "spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.6.html", "spec/spec/runner/formatter/html_formatter_spec.rb", "spec/spec/runner/formatter/nested_text_formatter_spec.rb", "spec/spec/runner/formatter/profile_formatter_spec.rb", "spec/spec/runner/formatter/progress_bar_formatter_spec.rb", "spec/spec/runner/formatter/snippet_extractor_spec.rb", "spec/spec/runner/formatter/spec_mate_formatter_spec.rb", "spec/spec/runner/formatter/specdoc_formatter_spec.rb", "spec/spec/runner/formatter/story/html_formatter_spec.rb", "spec/spec/runner/formatter/story/plain_text_formatter_spec.rb", "spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb", "spec/spec/runner/formatter/text_mate_formatted-1.8.4.html", "spec/spec/runner/formatter/text_mate_formatted-1.8.6.html", "spec/spec/runner/heckle_runner_spec.rb", "spec/spec/runner/heckler_spec.rb", "spec/spec/runner/noisy_backtrace_tweaker_spec.rb", "spec/spec/runner/option_parser_spec.rb", "spec/spec/runner/options_spec.rb", "spec/spec/runner/output_one_time_fixture.rb", "spec/spec/runner/output_one_time_fixture_runner.rb", "spec/spec/runner/output_one_time_spec.rb", "spec/spec/runner/quiet_backtrace_tweaker_spec.rb", "spec/spec/runner/reporter_spec.rb", "spec/spec/runner/resources/a_bar.rb", "spec/spec/runner/resources/a_foo.rb", "spec/spec/runner/resources/a_spec.rb", "spec/spec/runner/spec.opts", "spec/spec/runner/spec_drb.opts", "spec/spec/runner/spec_parser/spec_parser_fixture.rb", "spec/spec/runner/spec_parser_spec.rb", "spec/spec/runner/spec_spaced.opts", "spec/spec/runner_spec.rb", "spec/spec/spec_classes.rb", "spec/spec/story/builders.rb", "spec/spec/story/extensions/main_spec.rb", "spec/spec/story/extensions_spec.rb", "spec/spec/story/given_scenario_spec.rb", "spec/spec/story/runner/plain_text_story_runner_spec.rb", "spec/spec/story/runner/scenario_collector_spec.rb", "spec/spec/story/runner/scenario_runner_spec.rb", "spec/spec/story/runner/story_mediator_spec.rb", "spec/spec/story/runner/story_parser_spec.rb", "spec/spec/story/runner/story_runner_spec.rb", "spec/spec/story/runner_spec.rb", "spec/spec/story/scenario_spec.rb", "spec/spec/story/step_group_spec.rb", "spec/spec/story/step_mother_spec.rb", "spec/spec/story/step_spec.rb", "spec/spec/story/story_helper.rb", "spec/spec/story/story_spec.rb", "spec/spec/story/world_spec.rb", "spec/spec_helper.rb", "stories/all.rb", "stories/configuration/before_blocks.story", "stories/configuration/stories.rb", "stories/example_groups/autogenerated_docstrings", "stories/example_groups/example_group_with_should_methods", "stories/example_groups/nested_groups", "stories/example_groups/output", "stories/example_groups/stories.rb", "stories/helper.rb", "stories/interop/examples_and_tests_together", "stories/interop/stories.rb", "stories/interop/test_case_with_should_methods", "stories/mock_framework_integration/stories.rb", "stories/mock_framework_integration/use_flexmock.story", "stories/pending_stories/README", "stories/resources/helpers/cmdline.rb", "stories/resources/helpers/story_helper.rb", "stories/resources/matchers/smart_match.rb", "stories/resources/spec/before_blocks_example.rb", "stories/resources/spec/example_group_with_should_methods.rb", "stories/resources/spec/simple_spec.rb", "stories/resources/spec/spec_with_flexmock.rb", "stories/resources/steps/running_rspec.rb", "stories/resources/stories/failing_story.rb", "stories/resources/test/spec_and_test_together.rb", "stories/resources/test/test_case_with_should_methods.rb", "stories/stories/multiline_steps.story", "stories/stories/steps/multiline_steps.rb", "stories/stories/stories.rb", "story_server/prototype/javascripts/builder.js", "story_server/prototype/javascripts/controls.js", "story_server/prototype/javascripts/dragdrop.js", "story_server/prototype/javascripts/effects.js", "story_server/prototype/javascripts/prototype.js", "story_server/prototype/javascripts/rspec.js", "story_server/prototype/javascripts/scriptaculous.js", "story_server/prototype/javascripts/slider.js", "story_server/prototype/javascripts/sound.js", "story_server/prototype/javascripts/unittest.js", "story_server/prototype/lib/server.rb", "story_server/prototype/stories.html", "story_server/prototype/stylesheets/rspec.css", "story_server/prototype/stylesheets/test.css"]
13
+ s.has_rdoc = true
14
+ s.homepage = %q{http://rspec.info/}
15
+ s.rdoc_options = ["--main", "README.txt"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{rspec}
18
+ s.rubygems_version = %q{1.2.0}
19
+ s.summary = %q{rspec version 1.1.5}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 2
24
+
25
+ if current_version >= 3 then
26
+ s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
27
+ else
28
+ s.add_dependency(%q<hoe>, [">= 1.7.0"])
29
+ end
30
+ else
31
+ s.add_dependency(%q<hoe>, [">= 1.7.0"])
32
+ end
33
+ end
@@ -23,7 +23,6 @@ Autotest::Rspec tests/specs for a given file should find all the specs for a giv
23
23
  HERE
24
24
  end
25
25
 
26
-
27
26
  def common_setup
28
27
  @proc = mock Proc
29
28
  @kernel = mock Kernel
@@ -37,161 +36,111 @@ HERE
37
36
  end
38
37
  end
39
38
 
40
- describe Rspec, "rspec_commands" do
41
- it "should contain the various commands, ordered by preference" do
42
- Rspec.new.spec_commands.should == [
43
- File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec"),
44
- "#{Config::CONFIG['bindir']}/spec"
45
- ]
46
- end
47
- end
48
-
49
- describe Rspec, "selection of rspec command" do
50
- include AutotestHelper
51
-
52
- before(:each) do
53
- common_setup
54
- @rspec_autotest = Rspec.new
55
- end
56
-
57
- it "should try to find the spec command if it exists in ./bin and use it above everything else" do
58
- File.stub!(:exists?).and_return true
59
-
60
- spec_path = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
61
- File.should_receive(:exists?).with(spec_path).and_return true
62
- @rspec_autotest.spec_command.should == spec_path
63
- end
64
-
65
- it "should otherwise select the default spec command in gem_dir/bin/spec" do
66
- @rspec_autotest.stub!(:spec_commands).and_return ["/foo/spec"]
67
- Config::CONFIG.stub!(:[]).and_return "/foo"
68
- File.should_receive(:exists?).with("/foo/spec").and_return(true)
69
-
70
- @rspec_autotest.spec_command.should == "/foo/spec"
71
- end
72
-
73
- it "should raise an error if no spec command is found at all" do
74
- File.stub!(:exists?).and_return false
75
-
76
- lambda {
77
- @rspec_autotest.spec_command
78
- }.should raise_error(RspecCommandError, "No spec command could be found!")
79
- end
80
-
81
- end
82
-
83
- describe Rspec, "selection of rspec command (windows compatibility issues)" do
84
- include AutotestHelper
85
-
86
- before(:each) do
87
- common_setup
88
- end
89
-
90
- it "should use the ALT_SEPARATOR if it is non-nil" do
91
- @rspec_autotest = Rspec.new
92
- spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
93
- @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
94
- @rspec_autotest.spec_command(@windows_alt_separator).should == spec_command.gsub('/', @windows_alt_separator)
95
- end
96
-
97
- it "should not use the ALT_SEPATOR if it is nil" do
98
- @windows_alt_separator = nil
99
- @rspec_autotest = Rspec.new
100
- spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
101
- @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
102
- @rspec_autotest.spec_command.should == spec_command
103
- end
104
- end
105
-
106
- describe Rspec, "adding spec.opts --options" do
107
- before(:each) do
108
- @rspec_autotest = Rspec.new
109
- end
39
+ describe Rspec do
40
+ describe "adding spec.opts --options" do
41
+ before(:each) do
42
+ @rspec_autotest = Rspec.new
43
+ end
110
44
 
111
- it "should return the command line option to add spec.opts if the options file exists" do
112
- File.stub!(:exist?).and_return true
113
- @rspec_autotest.add_options_if_present.should == "-O spec/spec.opts "
114
- end
45
+ it "should return the command line option to add spec.opts if the options file exists" do
46
+ File.stub!(:exist?).and_return true
47
+ @rspec_autotest.add_options_if_present.should == "-O spec/spec.opts "
48
+ end
115
49
 
116
- it "should return an empty string if no spec.opts exists" do
117
- File.stub!(:exist?).and_return false
118
- Rspec.new.add_options_if_present.should == ""
119
- end
120
- end
50
+ it "should return an empty string if no spec.opts exists" do
51
+ File.stub!(:exist?).and_return false
52
+ Rspec.new.add_options_if_present.should == ""
53
+ end
54
+ end
121
55
 
122
- describe Rspec do
123
- before(:each) do
124
- @rspec_autotest = Rspec.new
125
- @rspec_autotest.stub!(:ruby).and_return "ruby"
126
- @rspec_autotest.stub!(:add_options_if_present).and_return "-O spec/spec.opts"
56
+ describe "commands" do
57
+ before(:each) do
58
+ @rspec_autotest = Rspec.new
59
+ @rspec_autotest.stub!(:ruby).and_return "ruby"
60
+ @rspec_autotest.stub!(:add_options_if_present).and_return "-O spec/spec.opts"
127
61
 
128
- @ruby = @rspec_autotest.ruby
129
- @spec_command = @rspec_autotest.spec_command
130
- @options = @rspec_autotest.add_options_if_present
131
- @files_to_test = {
132
- :spec => ["file_one", "file_two"]
133
- }
134
- # this is not the inner representation of Autotest!
135
- @rspec_autotest.stub!(:files_to_test).and_return @files_to_test
136
- @files_to_test.stub!(:keys).and_return @files_to_test[:spec]
137
- @to_test = @files_to_test.keys.flatten.join ' '
138
- end
139
-
140
- it "should make the apropriate test command" do
141
- @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} -S #{@spec_command} #{@options} #{@to_test}"
62
+ @ruby = @rspec_autotest.ruby
63
+ @options = @rspec_autotest.add_options_if_present
64
+ @files_to_test = {
65
+ :spec => ["file_one", "file_two"]
66
+ }
67
+ # this is not the inner representation of Autotest!
68
+ @rspec_autotest.stub!(:files_to_test).and_return @files_to_test
69
+ @files_to_test.stub!(:keys).and_return @files_to_test[:spec]
70
+ @to_test = @files_to_test.keys.flatten.join ' '
71
+ end
72
+
73
+ it "should make the appropriate test command" do
74
+ @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} -S #{@to_test} #{@options}"
75
+ end
76
+
77
+ it "should return a blank command for no files" do
78
+ @rspec_autotest.make_test_cmd({}).should == ''
79
+ end
142
80
  end
143
- end
144
81
 
145
- describe Rspec, "mappings" do
82
+ describe "mappings" do
146
83
 
147
- before(:each) do
148
- @lib_file = "lib/something.rb"
149
- @spec_file = "spec/something_spec.rb"
150
- @rspec_autotest = Rspec.new
151
- @rspec_autotest.hook :initialize
152
- end
84
+ before(:each) do
85
+ @lib_file = "lib/something.rb"
86
+ @spec_file = "spec/something_spec.rb"
87
+ @rspec_autotest = Rspec.new
88
+ @rspec_autotest.hook :initialize
89
+ end
153
90
 
154
- it "should find the spec file for a given lib file" do
155
- @rspec_autotest.should map_specs([@spec_file]).to(@lib_file)
156
- end
91
+ it "should find the spec file for a given lib file" do
92
+ @rspec_autotest.should map_specs([@spec_file]).to(@lib_file)
93
+ end
157
94
 
158
- it "should find the spec file if given a spec file" do
159
- @rspec_autotest.should map_specs([@spec_file]).to(@spec_file)
160
- end
95
+ it "should find the spec file if given a spec file" do
96
+ @rspec_autotest.should map_specs([@spec_file]).to(@spec_file)
97
+ end
161
98
 
162
- it "should only find the file if the file is being tracked (in @file)" do
163
- @rspec_autotest.should map_specs([]).to("lib/untracked_file")
99
+ it "should only find the file if the file is being tracked (in @file)" do
100
+ @rspec_autotest.should map_specs([]).to("lib/untracked_file")
101
+ end
164
102
  end
165
- end
166
103
 
167
- describe Rspec, "consolidating failures" do
168
- include AutotestHelper
104
+ describe "consolidating failures" do
105
+ include AutotestHelper
169
106
 
170
- before(:each) do
171
- common_setup
172
- @rspec_autotest = Rspec.new
107
+ before(:each) do
108
+ common_setup
109
+ @rspec_autotest = Rspec.new
173
110
 
174
- @spec_file = "spec/autotest/rspec_spec.rb"
175
- @rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now})
176
- @rspec_autotest.stub!(:find_files_to_test).and_return true
177
- end
178
-
179
- it "should return no failures if no failures were given in the output" do
180
- @rspec_autotest.consolidate_failures([[]]).should == {}
181
- end
182
-
183
- it "should return a hash with the spec filename => spec name for each failure or error" do
184
- @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/rspec_spec.rb"
185
- failures = [
186
- [
187
- "false should be false",
188
- "expected: true,\n got: false (using ==)\n#{@spec_file}:203:"
111
+ @spec_file = "spec/autotest/some_spec.rb"
112
+ @rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now})
113
+ @rspec_autotest.stub!(:find_files_to_test).and_return true
114
+ end
115
+
116
+ it "should return no failures if no failures were given in the output" do
117
+ @rspec_autotest.consolidate_failures([[]]).should == {}
118
+ end
119
+
120
+ it "should return a hash with the spec filename => spec name for each failure or error" do
121
+ @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/some_spec.rb"
122
+ failures = [
123
+ [
124
+ "false should be false",
125
+ "expected: true,\n got: false (using ==)\n#{@spec_file}:203:"
126
+ ]
189
127
  ]
190
- ]
191
- @rspec_autotest.consolidate_failures(failures).should == {
192
- @spec_file => ["false should be false"]
193
- }
128
+ @rspec_autotest.consolidate_failures(failures).should == {
129
+ @spec_file => ["false should be false"]
130
+ }
131
+ end
132
+
133
+ it "should not include the subject file" do
134
+ subject_file = "lib/autotest/some.rb"
135
+ @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/some_spec.rb"
136
+ failures = [
137
+ [
138
+ "false should be false",
139
+ "expected: true,\n got: false (using ==)\n#{subject_file}:143:\n#{@spec_file}:203:"
140
+ ]
141
+ ]
142
+ @rspec_autotest.consolidate_failures(failures).keys.should_not include(subject_file)
143
+ end
194
144
  end
195
-
196
145
  end
197
146
  end