rspec 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
File without changes
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['RSPEC'] = 'true'
3
+ ENV['AUTOTEST'] = 'true'
4
+ system("autotest", *ARGV)
data/bin/spec CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
3
3
  require 'spec'
4
- exit ::Spec::Runner::CommandLine.run(rspec_options)
4
+ exit ::Spec::Runner::CommandLine.run
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ class MessageAppender
4
+
5
+ def initialize(appendage)
6
+ @appendage = appendage
7
+ end
8
+
9
+ def append_to(message)
10
+ if_told_to_yield do
11
+ message << @appendage
12
+ end
13
+ end
14
+
15
+ end
16
+
17
+ describe "a message expectation yielding to a block" do
18
+ it "should yield if told to" do
19
+ appender = MessageAppender.new("appended to")
20
+ appender.should_receive(:if_told_to_yield).and_yield
21
+ message = ""
22
+ appender.append_to(message)
23
+ message.should == "appended to"
24
+ end
25
+
26
+ it "should not yield if not told to" do
27
+ appender = MessageAppender.new("appended to")
28
+ appender.should_receive(:if_told_to_yield)
29
+ message = ""
30
+ appender.append_to(message)
31
+ message.should == ""
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <loadpath>
3
+ <pathentry path="" type="src"/>
4
+ <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
5
+ </loadpath>
@@ -1,4 +1,4 @@
1
- $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'lib')
1
+ $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
2
  $:.unshift File.join(File.dirname(__FILE__), '..')
3
3
 
4
4
  require 'spec'
@@ -1,21 +1,21 @@
1
1
  Story: cells with more than three neighbours die
2
2
 
3
- As a game producer
4
- I want cells with more than three neighbours to die
5
- So that I can show the people with money how we are getting on
3
+ As a game producer
4
+ I want cells with more than three neighbours to die
5
+ So that I can show the people with money how we are getting on
6
6
 
7
- Scenario: blink
7
+ Scenario: blink
8
8
 
9
- Given the grid looks like
10
- .....
11
- ...XX
12
- ...XX
13
- .XX..
14
- .XX..
15
- When the next step occurs
16
- Then the grid should look like
17
- .....
18
- ...XX
19
- ....X
20
- .X...
21
- .XX..
9
+ Given the grid looks like
10
+ .....
11
+ ...XX
12
+ ...XX
13
+ .XX..
14
+ .XX..
15
+ When the next step occurs
16
+ Then the grid should look like
17
+ .....
18
+ ...XX
19
+ ....X
20
+ .X...
21
+ .XX..
data/init.rb ADDED
@@ -0,0 +1,9 @@
1
+ # Placeholder to satisfy Rails.
2
+ #
3
+ # Do NOT add any require statements to this file. Doing
4
+ # so will cause Rails to load this plugin all of the time.
5
+ #
6
+ # Running 'ruby script/generate rspec' will
7
+ # generate spec/spec_helper.rb, which includes the necessary
8
+ # require statements and configuration. This file should
9
+ # be required by all of your spec files.
@@ -1,3 +1,3 @@
1
1
  Autotest.add_discovery do
2
- "rspec" if File.exist?('spec')
2
+ "rspec" if File.exist?('spec') && ENV['RSPEC']
3
3
  end
@@ -28,7 +28,7 @@ class Autotest::Rspec < Autotest
28
28
  def consolidate_failures(failed)
29
29
  filters = new_hash_of_arrays
30
30
  failed.each do |spec, trace|
31
- if trace =~ /\n(\.\/)?(.*\.rb):[\d]+:\Z?/
31
+ if trace =~ /\n(\.\/)?(.*spec\.rb):[\d]+:\Z?/
32
32
  filters[$2] << spec
33
33
  end
34
34
  end
@@ -36,37 +36,11 @@ class Autotest::Rspec < Autotest
36
36
  end
37
37
 
38
38
  def make_test_cmd(files_to_test)
39
- return "#{ruby} -S #{spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}"
39
+ return '' if files_to_test.empty?
40
+ return "#{ruby} -S #{files_to_test.keys.flatten.join(' ')} #{add_options_if_present}"
40
41
  end
41
42
 
42
43
  def add_options_if_present # :nodoc:
43
44
  File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : ""
44
45
  end
45
-
46
- # Finds the proper spec command to use. Precendence is set in the
47
- # lazily-evaluated method spec_commands. Alias + Override that in
48
- # ~/.autotest to provide a different spec command then the default
49
- # paths provided.
50
- def spec_command(separator=File::ALT_SEPARATOR)
51
- unless defined? @spec_command then
52
- @spec_command = spec_commands.find { |cmd| File.exists? cmd }
53
-
54
- raise RspecCommandError, "No spec command could be found!" unless @spec_command
55
-
56
- @spec_command.gsub! File::SEPARATOR, separator if separator
57
- end
58
- @spec_command
59
- end
60
-
61
- # Autotest will look for spec commands in the following
62
- # locations, in this order:
63
- #
64
- # * bin/spec
65
- # * default spec bin/loader installed in Rubygems
66
- def spec_commands
67
- [
68
- File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')),
69
- File.join(Config::CONFIG['bindir'], 'spec')
70
- ]
71
- end
72
46
  end
@@ -1,30 +1,28 @@
1
- require 'spec/version'
2
1
  require 'spec/matchers'
3
2
  require 'spec/expectations'
4
3
  require 'spec/example'
5
4
  require 'spec/extensions'
6
5
  require 'spec/runner'
6
+ require 'spec/adapters'
7
+ require 'spec/version'
7
8
 
8
- if Object.const_defined?(:Test); \
9
- require 'spec/interop/test'; \
9
+ if Object.const_defined?(:Test)
10
+ require 'spec/interop/test'
10
11
  end
11
12
 
12
13
  module Spec
13
14
  class << self
14
15
  def run?
15
- @run || rspec_options.examples_run?
16
+ Runner.options.examples_run?
16
17
  end
17
18
 
18
- def run; \
19
- return true if run?; \
20
- result = rspec_options.run_examples; \
21
- @run = true; \
22
- result; \
19
+ def run
20
+ return true if run?
21
+ Runner.options.run_examples
23
22
  end
24
- attr_writer :run
25
23
 
26
- def exit?; \
27
- !Object.const_defined?(:Test) || Test::Unit.run?; \
24
+ def exit?
25
+ !Object.const_defined?(:Test) || Test::Unit.run?
28
26
  end
29
27
  end
30
28
  end
@@ -0,0 +1 @@
1
+ require 'spec/adapters/ruby_engine'
@@ -0,0 +1,26 @@
1
+ require 'spec/adapters/ruby_engine/mri'
2
+ require 'spec/adapters/ruby_engine/rubinius'
3
+
4
+ module Spec
5
+ module Adapters
6
+ module RubyEngine
7
+
8
+ ENGINES = {
9
+ 'mri' => MRI.new,
10
+ 'rbx' => Rubinius.new
11
+ }
12
+
13
+ def self.engine
14
+ if Object.const_defined?('RUBY_ENGINE')
15
+ return Object.const_get('RUBY_ENGINE')
16
+ else
17
+ return 'mri'
18
+ end
19
+ end
20
+
21
+ def self.adapter
22
+ return ENGINES[engine]
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,8 @@
1
+ module Spec
2
+ module Adapters
3
+ module RubyEngine
4
+ class MRI
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Spec
2
+ module Adapters
3
+ module RubyEngine
4
+ class Rubinius
5
+ end
6
+ end
7
+ end
8
+ end
@@ -1,6 +1,12 @@
1
1
  module Spec
2
2
  module Example
3
3
  class ExamplePendingError < StandardError
4
+ def initialize(a_message=nil)
5
+ super
6
+ @pending_caller = caller[2]
7
+ end
8
+
9
+ attr_reader :pending_caller
4
10
  end
5
11
 
6
12
  class PendingExampleFixedError < StandardError
@@ -3,6 +3,8 @@ module Spec
3
3
 
4
4
  module ExampleGroupMethods
5
5
  class << self
6
+ attr_accessor :matcher_class
7
+
6
8
  def description_text(*args)
7
9
  args.inject("") do |result, arg|
8
10
  result << " " unless (result == "" || arg.to_s =~ /^(\s|\.|#)/)
@@ -119,7 +121,7 @@ module Spec
119
121
 
120
122
  def run
121
123
  examples = examples_to_run
122
- reporter.add_example_group(self)
124
+ reporter.add_example_group(self) unless examples_to_run.empty?
123
125
  return true if examples.empty?
124
126
  return dry_run(examples) if dry_run?
125
127
 
@@ -169,7 +171,7 @@ module Spec
169
171
  def examples #:nodoc:
170
172
  examples = example_objects.dup
171
173
  add_method_examples(examples)
172
- rspec_options.reverse ? examples.reverse : examples
174
+ Spec::Runner.options.reverse ? examples.reverse : examples
173
175
  end
174
176
 
175
177
  def number_of_examples #:nodoc:
@@ -250,15 +252,15 @@ module Spec
250
252
 
251
253
  def register(&registration_binding_block)
252
254
  @registration_binding_block = registration_binding_block
253
- rspec_options.add_example_group self
255
+ Spec::Runner.options.add_example_group self
254
256
  end
255
257
 
256
258
  def unregister #:nodoc:
257
- rspec_options.remove_example_group self
259
+ Spec::Runner.options.remove_example_group self
258
260
  end
259
261
 
260
262
  def registration_backtrace
261
- eval("caller", registration_binding_block.binding)
263
+ eval("caller", registration_binding_block)
262
264
  end
263
265
 
264
266
  def run_before_each(example)
@@ -276,8 +278,8 @@ module Spec
276
278
  private
277
279
  def dry_run(examples)
278
280
  examples.each do |example|
279
- rspec_options.reporter.example_started(example)
280
- rspec_options.reporter.example_finished(example)
281
+ Spec::Runner.options.reporter.example_started(example)
282
+ Spec::Runner.options.reporter.example_finished(example)
281
283
  end
282
284
  return true
283
285
  end
@@ -300,7 +302,7 @@ module Spec
300
302
 
301
303
  after_all_instance_variables = instance_variables
302
304
  examples.each do |example_group_instance|
303
- success &= example_group_instance.execute(rspec_options, instance_variables)
305
+ success &= example_group_instance.execute(Spec::Runner.options, instance_variables)
304
306
  after_all_instance_variables = example_group_instance.instance_variable_hash
305
307
  end
306
308
  return [success, after_all_instance_variables]
@@ -322,7 +324,8 @@ module Spec
322
324
  all_examples = examples
323
325
  return all_examples unless specified_examples?
324
326
  all_examples.reject do |example|
325
- matcher = ExampleMatcher.new(description.to_s, example.description)
327
+ matcher = ExampleGroupMethods.matcher_class.
328
+ new(description.to_s, example.description)
326
329
  !matcher.matches?(specified_examples)
327
330
  end
328
331
  end
@@ -332,15 +335,15 @@ module Spec
332
335
  end
333
336
 
334
337
  def specified_examples
335
- rspec_options.examples
338
+ Spec::Runner.options.examples
336
339
  end
337
340
 
338
341
  def reporter
339
- rspec_options.reporter
342
+ Spec::Runner.options.reporter
340
343
  end
341
344
 
342
345
  def dry_run?
343
- rspec_options.dry_run
346
+ Spec::Runner.options.dry_run
344
347
  end
345
348
 
346
349
  def example_objects
@@ -395,7 +398,7 @@ module Spec
395
398
  case scope
396
399
  when :each; before_each_parts
397
400
  when :all; before_all_parts
398
- when :suite; rspec_options.before_suite_parts
401
+ when :suite; Spec::Runner.options.before_suite_parts
399
402
  end
400
403
  end
401
404
 
@@ -403,7 +406,7 @@ module Spec
403
406
  case scope
404
407
  when :each; after_each_parts
405
408
  when :all; after_all_parts
406
- when :suite; rspec_options.after_suite_parts
409
+ when :suite; Spec::Runner.options.after_suite_parts
407
410
  end
408
411
  end
409
412
 
@@ -38,5 +38,7 @@ module Spec
38
38
  Regexp.escape(@example_name)
39
39
  end
40
40
  end
41
+
42
+ ExampleGroupMethods.matcher_class = ExampleMatcher
41
43
  end
42
44
  end
@@ -18,7 +18,7 @@ module Spec
18
18
  Timeout.timeout(options.timeout) do
19
19
  begin
20
20
  before_example
21
- run_with_description_capturing
21
+ eval_block
22
22
  rescue Exception => e
23
23
  execution_error ||= e
24
24
  end
@@ -63,7 +63,7 @@ module Spec
63
63
  end
64
64
 
65
65
  def description
66
- @_defined_description || @_matcher_description || "NO NAME"
66
+ @_defined_description || ::Spec::Matchers.generated_description || "NO NAME"
67
67
  end
68
68
 
69
69
  def __full_description
@@ -79,13 +79,8 @@ module Spec
79
79
  end
80
80
  end
81
81
 
82
- def run_with_description_capturing
83
- begin
84
- return instance_eval(&(@_implementation || PENDING_EXAMPLE_BLOCK))
85
- ensure
86
- @_matcher_description = Spec::Matchers.generated_description
87
- Spec::Matchers.clear_generated_description
88
- end
82
+ def eval_block
83
+ return instance_eval(&(@_implementation || PENDING_EXAMPLE_BLOCK))
89
84
  end
90
85
 
91
86
  def implementation_backtrace
@@ -22,7 +22,8 @@ module Spec
22
22
  end
23
23
  end
24
24
 
25
- def respond_to?(sym)
25
+ # NOTE - we don't need the second arg, but extenders do: http://www.ruby-doc.org/core/classes/Object.html#M000604
26
+ def respond_to?(sym, include_private_data=false)
26
27
  MethodDispatcher.new(self.class.described_module).respond_to?(sym) ? true : super
27
28
  end
28
29
 
@@ -27,7 +27,7 @@ module Spec
27
27
  #
28
28
  # NOTE that this does NOT support receiver.should != expected.
29
29
  # Instead, use receiver.should_not == expected
30
- def should(matcher=:use_operator_matcher, &block)
30
+ def should(matcher=nil, &block)
31
31
  ExpectationMatcherHandler.handle_matcher(self, matcher, &block)
32
32
  end
33
33
 
@@ -50,7 +50,7 @@ module Spec
50
50
  # => Passes unless (receiver =~ regexp)
51
51
  #
52
52
  # See Spec::Matchers for more information about matchers
53
- def should_not(matcher=:use_operator_matcher, &block)
53
+ def should_not(matcher=nil, &block)
54
54
  NegativeExpectationMatcherHandler.handle_matcher(self, matcher, &block)
55
55
  end
56
56