rspec 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/CHANGES +90 -1
  2. data/EXAMPLES.rd +28 -6
  3. data/MIT-LICENSE +20 -0
  4. data/README +18 -12
  5. data/Rakefile +60 -54
  6. data/examples/custom_formatter.rb +4 -4
  7. data/examples/helper_method_example.rb +11 -0
  8. data/examples/mocking_example.rb +19 -2
  9. data/examples/partial_mock_example.rb +28 -0
  10. data/examples/stack_spec.rb +8 -8
  11. data/examples/stubbing_example.rb +50 -9
  12. data/examples/test_case_spec.rb +6 -6
  13. data/lib/spec.rb +1 -2
  14. data/lib/spec/callback.rb +0 -0
  15. data/lib/spec/expectations.rb +3 -6
  16. data/lib/spec/expectations/diff.rb +23 -47
  17. data/lib/spec/expectations/differs/default.rb +62 -0
  18. data/lib/spec/expectations/{exceptions.rb → errors.rb} +0 -0
  19. data/lib/spec/expectations/extensions.rb +4 -0
  20. data/lib/spec/expectations/extensions/inspect_for_expectation_not_met_error.rb +14 -0
  21. data/lib/spec/expectations/extensions/numeric.rb +5 -0
  22. data/lib/spec/expectations/{expectations.rb → extensions/object.rb} +3 -6
  23. data/lib/spec/expectations/extensions/symbol.rb +5 -0
  24. data/lib/spec/expectations/should.rb +4 -0
  25. data/lib/spec/expectations/should/base.rb +42 -0
  26. data/lib/spec/expectations/should/have.rb +79 -0
  27. data/lib/spec/expectations/should/not.rb +72 -0
  28. data/lib/spec/expectations/should/should.rb +83 -0
  29. data/lib/spec/expectations/sugar.rb +6 -25
  30. data/lib/spec/mocks.rb +5 -1
  31. data/lib/spec/mocks/argument_expectation.rb +15 -1
  32. data/lib/spec/mocks/error_generator.rb +72 -0
  33. data/lib/spec/mocks/{exceptions.rb → errors.rb} +0 -0
  34. data/lib/spec/mocks/extensions/object.rb +3 -0
  35. data/lib/spec/mocks/message_expectation.rb +80 -73
  36. data/lib/spec/mocks/mock.rb +4 -69
  37. data/lib/spec/mocks/mock_handler.rb +158 -0
  38. data/lib/spec/mocks/mock_methods.rb +44 -0
  39. data/lib/spec/mocks/order_group.rb +10 -2
  40. data/lib/spec/rake/spectask.rb +20 -18
  41. data/lib/spec/rake/{rcov_verify.rb → verify_rcov.rb} +2 -2
  42. data/lib/spec/runner.rb +3 -1
  43. data/lib/spec/runner/backtrace_tweaker.rb +2 -1
  44. data/lib/spec/runner/context.rb +10 -16
  45. data/lib/spec/runner/context_eval.rb +40 -40
  46. data/lib/spec/runner/execution_context.rb +1 -12
  47. data/lib/spec/runner/{kernel_ext.rb → extensions/kernel.rb} +2 -2
  48. data/lib/spec/runner/{instance_exec.rb → extensions/object.rb} +0 -0
  49. data/lib/spec/runner/formatter/base_text_formatter.rb +25 -18
  50. data/lib/spec/runner/formatter/html_formatter.rb +81 -101
  51. data/lib/spec/runner/formatter/progress_bar_formatter.rb +9 -9
  52. data/lib/spec/runner/formatter/rdoc_formatter.rb +6 -6
  53. data/lib/spec/runner/formatter/specdoc_formatter.rb +7 -6
  54. data/lib/spec/runner/option_parser.rb +41 -5
  55. data/lib/spec/runner/reporter.rb +3 -15
  56. data/lib/spec/runner/spec_should_raise_handler.rb +74 -0
  57. data/lib/spec/runner/specification.rb +33 -14
  58. data/lib/spec/version.rb +6 -3
  59. data/vendor/watir/README.txt +1 -1
  60. metadata +34 -68
  61. data/bin/test2spec +0 -112
  62. data/examples/helper_method_spec.rb +0 -12
  63. data/lib/spec/expectations/have_helper.rb +0 -41
  64. data/lib/spec/expectations/helper.rb +0 -4
  65. data/lib/spec/expectations/should_base.rb +0 -52
  66. data/lib/spec/expectations/should_helper.rb +0 -93
  67. data/lib/spec/expectations/should_negator.rb +0 -71
  68. data/lib/spec/test_to_spec/ruby2ruby.rb +0 -492
  69. data/lib/spec/test_to_spec/sexp_transformer.rb +0 -196
  70. data/lib/spec/test_to_spec/test_case_ext.rb +0 -22
  71. data/lib/spec/test_to_spec/translation_test_runner.rb +0 -147
  72. data/test/spec/expectations/arbitrary_operator_test.rb +0 -55
  73. data/test/spec/expectations/arbitrary_predicate_test.rb +0 -163
  74. data/test/spec/expectations/containment_test.rb +0 -129
  75. data/test/spec/expectations/diff_test.rb +0 -62
  76. data/test/spec/expectations/identity_test.rb +0 -75
  77. data/test/spec/expectations/object_equality_test.rb +0 -65
  78. data/test/spec/expectations/raising_test.rb +0 -106
  79. data/test/spec/expectations/regex_matching_test.rb +0 -36
  80. data/test/spec/expectations/should_have_test.rb +0 -169
  81. data/test/spec/expectations/should_satisfy_test.rb +0 -37
  82. data/test/spec/expectations/sugar_test.rb +0 -93
  83. data/test/spec/expectations/supported_symbols_test.rb +0 -33
  84. data/test/spec/expectations/throwing_test.rb +0 -55
  85. data/test/spec/expectations/true_false_special_case_test.rb +0 -85
  86. data/test/spec/expectations/typing_test.rb +0 -108
  87. data/test/spec/mocks/mock_arg_constraints_test.rb +0 -113
  88. data/test/spec/mocks/mock_counts_test.rb +0 -431
  89. data/test/spec/mocks/mock_ordering_test.rb +0 -109
  90. data/test/spec/mocks/mock_test.rb +0 -220
  91. data/test/spec/mocks/null_object_test.rb +0 -37
  92. data/test/spec/runner/backtrace_tweaker_test.rb +0 -90
  93. data/test/spec/runner/context_matching_test.rb +0 -35
  94. data/test/spec/runner/context_runner_test.rb +0 -62
  95. data/test/spec/runner/context_test.rb +0 -191
  96. data/test/spec/runner/execution_context_test.rb +0 -45
  97. data/test/spec/runner/formatter/failure_dump_test.rb +0 -94
  98. data/test/spec/runner/formatter/html_formatter_test.rb +0 -48
  99. data/test/spec/runner/formatter/progress_bar_formatter_test.rb +0 -56
  100. data/test/spec/runner/formatter/rdoc_formatter_test.rb +0 -51
  101. data/test/spec/runner/formatter/specdoc_formatter_test.rb +0 -57
  102. data/test/spec/runner/kernel_ext_test.rb +0 -13
  103. data/test/spec/runner/option_parser_test.rb +0 -141
  104. data/test/spec/runner/reporter_test.rb +0 -128
  105. data/test/spec/runner/spec_matcher_test.rb +0 -47
  106. data/test/spec/runner/specification_test.rb +0 -121
  107. data/test/spec/test_to_spec/ruby_to_ruby_test.rb +0 -79
  108. data/test/spec/test_to_spec/sexp_transformer_assertion_test.rb +0 -207
  109. data/test/spec/test_to_spec/sexp_transformer_test.rb +0 -303
  110. data/test/spec/test_to_spec/test_case_ext_test.rb +0 -25
  111. data/test/spec/test_to_spec/testfiles/test_unit_api_spec.rb +0 -75
  112. data/test/spec/test_to_spec/testfiles/test_unit_api_test.rb +0 -70
  113. data/test/test_classes.rb +0 -102
  114. data/test/test_helper.rb +0 -32
@@ -0,0 +1,28 @@
1
+ require File.dirname(__FILE__) + '/../lib/spec'
2
+
3
+ class MockableClass
4
+ def self.find id
5
+ return :original_return
6
+ end
7
+ end
8
+
9
+ context "A partial mock" do
10
+
11
+ specify "should work at the class level" do
12
+ MockableClass.should_receive(:find).with(1).and_return {:stub_return}
13
+ MockableClass.find(1).should_equal :stub_return
14
+ end
15
+
16
+ specify "should revert to the original after each spec" do
17
+ MockableClass.find(1).should_equal :original_return
18
+ end
19
+
20
+ specify "can be mocked w/ ordering" do
21
+ MockableClass.should_receive(:msg_1).ordered
22
+ MockableClass.should_receive(:msg_2).ordered
23
+ MockableClass.should_receive(:msg_3).ordered
24
+ MockableClass.msg_1
25
+ MockableClass.msg_2
26
+ MockableClass.msg_3
27
+ end
28
+ end
@@ -1,7 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/../lib/spec'
2
2
  require File.dirname(__FILE__) + "/stack"
3
3
 
4
- context "A stack (in general)" do
4
+ context "A stack which is neither empty nor full" do
5
5
  setup do
6
6
  @stack = Stack.new
7
7
  ["a","b","c"].each { |x| @stack.push x }
@@ -9,25 +9,25 @@ context "A stack (in general)" do
9
9
 
10
10
  specify "should add to the top when sent 'push'" do
11
11
  @stack.push "d"
12
- @stack.peek.should_equal "d"
12
+ @stack.peek.should == "d"
13
13
  end
14
14
 
15
15
  specify "should return the top item when sent 'peek'" do
16
- @stack.peek.should_equal "c"
16
+ @stack.peek.should == "c"
17
17
  end
18
18
 
19
19
  specify "should NOT remove the top item when sent 'peek'" do
20
- @stack.peek.should_equal "c"
21
- @stack.peek.should_equal "c"
20
+ @stack.peek.should == "c"
21
+ @stack.peek.should == "c"
22
22
  end
23
23
 
24
24
  specify "should return the top item when sent 'pop'" do
25
- @stack.pop.should_equal "c"
25
+ @stack.pop.should == "c"
26
26
  end
27
27
 
28
28
  specify "should remove the top item when sent 'pop'" do
29
- @stack.pop.should_equal "c"
30
- @stack.pop.should_equal "b"
29
+ @stack.pop.should == "c"
30
+ @stack.pop.should == "b"
31
31
  end
32
32
  end
33
33
 
@@ -1,13 +1,11 @@
1
1
  require File.dirname(__FILE__) + '/../lib/spec'
2
2
 
3
3
  context "A consumer of a stub" do
4
-
5
- specify "should be able to stub objects" do
4
+ specify "should be able to stub methods on any Object" do
6
5
  obj = Object.new
7
- stub(obj).method(:foobar).with {:return_value}
6
+ obj.stub!(:foobar).and_return {:return_value}
8
7
  obj.foobar.should_equal :return_value
9
8
  end
10
-
11
9
  end
12
10
 
13
11
  class StubbableClass
@@ -16,13 +14,56 @@ class StubbableClass
16
14
  end
17
15
  end
18
16
 
19
- context "A stub" do
20
- specify "should work at the class level" do
21
- stub(StubbableClass).method(:find).with {:stub_return}
17
+ context "A stubbed method on a class" do
18
+ specify "should return the stubbed value" do
19
+ StubbableClass.stub!(:find).and_return(:stub_return)
22
20
  StubbableClass.find(1).should_equal :stub_return
23
21
  end
24
22
 
25
- specify "should revert to the original after each spec" do
23
+ specify "should revert to the original method after each spec" do
26
24
  StubbableClass.find(1).should_equal :original_return
27
25
  end
28
- end
26
+
27
+ specify "can stub! and mock the same message" do
28
+ StubbableClass.stub!(:msg).and_return(:stub_value)
29
+ StubbableClass.should_receive(:msg).with(:arg).and_return(:mock_value)
30
+
31
+ StubbableClass.msg.should_equal :stub_value
32
+ StubbableClass.msg(:other_arg).should_equal :stub_value
33
+ StubbableClass.msg(:arg).should_equal :mock_value
34
+ StubbableClass.msg(:another_arg).should_equal :stub_value
35
+ StubbableClass.msg(:yet_another_arg).should_equal :stub_value
36
+ StubbableClass.msg.should_equal :stub_value
37
+ end
38
+ end
39
+
40
+ context "A mock" do
41
+ specify "can stub!" do
42
+ mock = mock("stubbing mock")
43
+ mock.stub!(:msg).and_return(:value)
44
+ (1..10).each {mock.msg.should_equal :value}
45
+ end
46
+
47
+ specify "can stub! and mock" do
48
+ mock = mock("stubbing mock")
49
+ mock.stub!(:stub_message).and_return(:stub_value)
50
+ mock.should_receive(:mock_message).once.and_return(:mock_value)
51
+ (1..10).each {mock.stub_message.should_equal :stub_value}
52
+ mock.mock_message.should_equal :mock_value
53
+ (1..10).each {mock.stub_message.should_equal :stub_value}
54
+ end
55
+
56
+ specify "can stub! and mock the same message" do
57
+ mock = mock("stubbing mock")
58
+ mock.stub!(:msg).and_return(:stub_value)
59
+ mock.should_receive(:msg).with(:arg).and_return(:mock_value)
60
+ mock.msg.should_equal :stub_value
61
+ mock.msg(:other_arg).should_equal :stub_value
62
+ mock.msg(:arg).should_equal :mock_value
63
+ mock.msg(:another_arg).should_equal :stub_value
64
+ mock.msg(:yet_another_arg).should_equal :stub_value
65
+ mock.msg.should_equal :stub_value
66
+ end
67
+ end
68
+
69
+
@@ -1,7 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/../lib/spec'
2
2
  require 'test/unit'
3
3
 
4
- class RspecIntegrationTest < Test::Unit::TestCase
4
+ class RSpecIntegrationTest < Test::Unit::TestCase
5
5
  def self.fixtures(*args)
6
6
  @@fixtures = true
7
7
  end
@@ -32,8 +32,8 @@ module RandomHelperModule
32
32
  end
33
33
  end
34
34
 
35
- context "Rspec should integrate with Test::Unit::TestCase" do
36
- inherit RspecIntegrationTest
35
+ context "RSpec should integrate with Test::Unit::TestCase" do
36
+ inherit RSpecIntegrationTest
37
37
  include RandomHelperModule
38
38
 
39
39
  fixtures :some_table
@@ -47,17 +47,17 @@ context "Rspec should integrate with Test::Unit::TestCase" do
47
47
  @rspec_setup_called.should_be true
48
48
  end
49
49
 
50
- specify "Rspec should be able to access TestCase methods" do
50
+ specify "RSpec should be able to access TestCase methods" do
51
51
  helper_method
52
52
  @helper_method_called.should_be true
53
53
  end
54
54
 
55
- specify "Rspec should be able to accept included modules" do
55
+ specify "RSpec should be able to accept included modules" do
56
56
  random_task
57
57
  @random_task_called.should_be true
58
58
  end
59
59
 
60
60
  teardown do
61
- RspecIntegrationTest.verify_class_method
61
+ RSpecIntegrationTest.verify_class_method
62
62
  end
63
63
  end
@@ -1,5 +1,4 @@
1
1
  require 'spec/version'
2
2
  require 'spec/expectations'
3
3
  require 'spec/mocks'
4
- require 'spec/runner'
5
- require 'spec/runner/kernel_ext'
4
+ require 'spec/runner'
File without changes
@@ -1,7 +1,4 @@
1
- require 'spec/expectations/exceptions'
2
- require 'spec/expectations/expectations'
3
- require 'spec/expectations/should_base'
4
- require 'spec/expectations/have_helper'
5
- require 'spec/expectations/should_helper'
6
- require 'spec/expectations/should_negator'
7
1
  require 'spec/expectations/sugar'
2
+ require 'spec/expectations/errors'
3
+ require 'spec/expectations/extensions'
4
+ require 'spec/expectations/should'
@@ -1,56 +1,32 @@
1
- begin
2
- require 'rubygems'
3
- require 'diff/lcs' #necessary to do loading bug on some machines - not sure why - DaC
4
- require 'diff/lcs/hunk'
5
- rescue LoadError
6
- raise "You must gem install diff-lcs to use diffing"
7
- end
8
-
9
1
  module Spec
10
2
  module Expectations
11
- class ShouldBase
12
- unless defined?(RSPEC_TESTING)
13
- alias old_default_message default_message
14
- def default_message(expectation, expected=:no_expectation_specified)
15
- result = old_default_message(expectation, expected)
16
- if expected.is_a?(String)
17
- result << "\nDiff:" << diff_as_string(@target.to_s, expected)
18
- end
19
- result
3
+ module Should
4
+ class Base
5
+ unless defined? @@differ
6
+ @@differ = nil
7
+ end
8
+ def self.differ=(differ)
9
+ @@differ = differ
20
10
  end
21
- end
22
11
 
23
- # This is snagged from diff/lcs/ldiff.rb (which is a commandline tool)
24
- def diff_as_string(data_old, data_new, format=:unified, context_lines=3)
25
- data_old = data_old.split(/\n/).map! { |e| e.chomp }
26
- data_new = data_new.split(/\n/).map! { |e| e.chomp }
27
- output = ""
28
- diffs = Diff::LCS.diff(data_old, data_new)
29
- return output if diffs.empty?
30
- oldhunk = hunk = nil
31
- file_length_difference = 0
32
- diffs.each do |piece|
33
- begin
34
- hunk = Diff::LCS::Hunk.new(data_old, data_new, piece, context_lines,
35
- file_length_difference)
36
- file_length_difference = hunk.file_length_difference
37
- next unless oldhunk
38
- # Hunks may overlap, which is why we need to be careful when our
39
- # diff includes lines of context. Otherwise, we might print
40
- # redundant lines.
41
- if (context_lines > 0) and hunk.overlaps?(oldhunk)
42
- hunk.unshift(oldhunk)
43
- else
44
- output << oldhunk.diff(format)
12
+ unless defined?(RSPEC_TESTING)
13
+ alias old_default_message default_message
14
+ def default_message(expectation, expected=:no_expectation_specified)
15
+ result = old_default_message(expectation, expected)
16
+
17
+ if expected != :no_expectation_specified
18
+ if expected.is_a?(String)
19
+ result << "\nDiff:" << @@differ.diff_as_string(@target.to_s, expected)
20
+ elsif ! @target.is_a? Proc
21
+ result << "\nDiff:" << @@differ.diff_as_object(@target,expected)
22
+ end
45
23
  end
46
- ensure
47
- oldhunk = hunk
48
- output << "\n"
24
+
25
+ result
49
26
  end
50
- end
51
- #Handle the last remaining hunk
52
- output << oldhunk.diff(format) << "\n"
53
- end
27
+ end
28
+
29
+ end
54
30
  end
55
31
  end
56
32
  end
@@ -0,0 +1,62 @@
1
+ begin
2
+ require 'rubygems'
3
+ require 'diff/lcs' #necessary due to loading bug on some machines - not sure why - DaC
4
+ require 'diff/lcs/hunk'
5
+ rescue LoadError ; raise "You must gem install diff-lcs to use diffing" ; end
6
+
7
+ require 'pp'
8
+
9
+ module Spec
10
+ module Expectations
11
+ module Differs
12
+
13
+ # TODO add colour support
14
+ # TODO add some rdoc
15
+ class Default
16
+ def initialize(format=:unified,context_lines=nil,colour=nil)
17
+
18
+ context_lines ||= 3
19
+ colour ||= false
20
+
21
+ @format,@context_lines,@colour = format,context_lines,colour
22
+ end
23
+
24
+ # This is snagged from diff/lcs/ldiff.rb (which is a commandline tool)
25
+ def diff_as_string(data_old, data_new)
26
+ data_old = data_old.split(/\n/).map! { |e| e.chomp }
27
+ data_new = data_new.split(/\n/).map! { |e| e.chomp }
28
+ output = ""
29
+ diffs = Diff::LCS.diff(data_old, data_new)
30
+ return output if diffs.empty?
31
+ oldhunk = hunk = nil
32
+ file_length_difference = 0
33
+ diffs.each do |piece|
34
+ begin
35
+ hunk = Diff::LCS::Hunk.new(data_old, data_new, piece, @context_lines,
36
+ file_length_difference)
37
+ file_length_difference = hunk.file_length_difference
38
+ next unless oldhunk
39
+ # Hunks may overlap, which is why we need to be careful when our
40
+ # diff includes lines of context. Otherwise, we might print
41
+ # redundant lines.
42
+ if (@context_lines > 0) and hunk.overlaps?(oldhunk)
43
+ hunk.unshift(oldhunk)
44
+ else
45
+ output << oldhunk.diff(@format)
46
+ end
47
+ ensure
48
+ oldhunk = hunk
49
+ output << "\n"
50
+ end
51
+ end
52
+ #Handle the last remaining hunk
53
+ output << oldhunk.diff(@format) << "\n"
54
+ end
55
+
56
+ def diff_as_object(target,expected)
57
+ diff_as_string(PP.pp(target,""), PP.pp(expected,""))
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,4 @@
1
+ require 'spec/expectations/extensions/object'
2
+ require 'spec/expectations/extensions/numeric'
3
+ require 'spec/expectations/extensions/symbol'
4
+ require 'spec/expectations/extensions/inspect_for_expectation_not_met_error'
@@ -0,0 +1,14 @@
1
+ class Object
2
+ def inspect_for_expectation_not_met_error
3
+ return "#{inspect}" if inspect.include? "<"
4
+ return "<#{inspect}>" unless inspect.include? "<"
5
+ end
6
+ end
7
+ class TrueClass; def inspect_for_expectation_not_met_error; "true" end end
8
+ class FalseClass; def inspect_for_expectation_not_met_error; "false" end end
9
+ class NilClass; def inspect_for_expectation_not_met_error; "nil" end end
10
+ class Class; def inspect_for_expectation_not_met_error; "<#{name}>" end end
11
+ class Proc; def inspect_for_expectation_not_met_error; "<Proc>" end end
12
+ class Array; def inspect_for_expectation_not_met_error; inspect end end
13
+ class String; def inspect_for_expectation_not_met_error; inspect end end
14
+ class Numeric; def inspect_for_expectation_not_met_error; inspect end end
@@ -0,0 +1,5 @@
1
+ class Numeric
2
+ def close?(other, precision)
3
+ (self - other).abs < precision
4
+ end
5
+ end
@@ -2,7 +2,7 @@ module Spec
2
2
  module Expectations
3
3
  module ObjectExpectations
4
4
  def should
5
- ShouldHelper.new self
5
+ Should::Should.new self
6
6
  end
7
7
  end
8
8
  end
@@ -10,10 +10,7 @@ end
10
10
 
11
11
  class Object
12
12
  include Spec::Expectations::ObjectExpectations
13
+ include Spec::Expectations::UnderscoreSugar
13
14
  end
14
15
 
15
- class Numeric
16
- def close?(other, precision)
17
- (self - other).abs < precision
18
- end
19
- end
16
+ Object.handle_underscores_for_rspec!
@@ -0,0 +1,5 @@
1
+ class Symbol
2
+ def supported_by_rspec?
3
+ return ["<","<=",">=",">","==","=~"].include?(to_s)
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ require 'spec/expectations/should/base'
2
+ require 'spec/expectations/should/have'
3
+ require 'spec/expectations/should/not'
4
+ require 'spec/expectations/should/should'
@@ -0,0 +1,42 @@
1
+ module Spec
2
+ module Expectations
3
+ module Should
4
+ class Base
5
+
6
+ instance_methods.each { |m| undef_method m unless m =~ /^(__|\w)/ }
7
+
8
+ def default_message(expectation, expected=:no_expectation_specified)
9
+ message = "#{@target.inspect_for_expectation_not_met_error} #{expectation}"
10
+ if (expected != :no_expectation_specified)
11
+ message << " " << expected.inspect_for_expectation_not_met_error
12
+ end
13
+ message
14
+ end
15
+
16
+ def fail_with_message(message)
17
+ Kernel::raise(Spec::Expectations::ExpectationNotMetError.new(message))
18
+ end
19
+
20
+ def find_supported_sym(original_sym)
21
+ ["#{original_sym}?", "#{original_sym}s?"].each do |alternate_sym|
22
+ return alternate_sym.to_s if @target.respond_to?(alternate_sym.to_s)
23
+ end
24
+ return original_sym.supported_by_rspec? ? original_sym : "#{original_sym}?"
25
+ end
26
+
27
+ def method_missing(original_sym, *args, &block)
28
+ if original_sym.to_s =~ /^not_/
29
+ return Not.new(@target).__send__(original_sym.to_s[4..-1].to_sym, *args, &block)
30
+ end
31
+ if original_sym.to_s =~ /^be_/
32
+ return __send__(original_sym.to_s[3..-1].to_sym, *args, &block)
33
+ end
34
+ if original_sym.to_s =~ /^have_/
35
+ return have.__send__(original_sym.to_s[5..-1].to_sym, *args, &block)
36
+ end
37
+ __delegate_method_missing_to_target original_sym, find_supported_sym(original_sym), *args
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end