rspec 0.5.16 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +12 -0
- data/EXAMPLES.rd +2 -2
- data/examples/custom_method_spec.rb +2 -2
- data/examples/mocking_spec.rb +2 -2
- data/lib/spec/api/helper.rb +0 -6
- data/lib/spec/api/helper/diff.rb +1 -0
- data/lib/spec/api/helper/have_helper.rb +7 -23
- data/lib/spec/api/helper/should_helper.rb +23 -19
- data/lib/spec/api/helper/should_negator.rb +10 -18
- data/lib/spec/api/mocks/argument_expectation.rb +2 -2
- data/lib/spec/api/mocks/message_expectation.rb +28 -53
- data/lib/spec/api/mocks/mock.rb +4 -5
- data/lib/spec/api/sugar.rb +6 -23
- data/lib/spec/runner/instance_exec.rb +11 -5
- data/lib/spec/version.rb +2 -2
- data/test/spec/api/helper/arbitrary_predicate_test.rb +16 -16
- data/test/spec/api/helper/containment_test.rb +16 -16
- data/test/spec/api/helper/identity_test.rb +8 -8
- data/test/spec/api/helper/object_equality_test.rb +13 -13
- data/test/spec/api/helper/raising_test.rb +14 -14
- data/test/spec/api/helper/regex_matching_test.rb +4 -4
- data/test/spec/api/helper/should_have_test.rb +26 -20
- data/test/spec/api/helper/should_satisfy_test.rb +5 -5
- data/test/spec/api/helper/throwing_test.rb +7 -7
- data/test/spec/api/helper/true_false_special_case_test.rb +12 -12
- data/test/spec/api/helper/typing_test.rb +14 -14
- data/test/spec/api/mocks/mock_arg_constraints_test.rb +26 -20
- data/test/spec/api/mocks/mock_counts_test.rb +431 -0
- data/test/spec/api/mocks/mock_ordering_test.rb +61 -42
- data/test/spec/api/mocks/mock_test.rb +68 -230
- data/test/spec/api/sugar_test.rb +1 -1
- data/test/spec/runner/backtrace_tweaker_test.rb +2 -2
- data/test/spec/runner/context_runner_test.rb +4 -4
- data/test/spec/runner/context_test.rb +22 -22
- data/test/spec/runner/execution_context_test.rb +1 -1
- data/test/spec/runner/reporter_test.rb +6 -6
- data/test/spec/runner/specification_test.rb +30 -30
- data/test/test_classes.rb +13 -4
- metadata +6 -11
- data/lib/spec/api/helper/instance_helper.rb +0 -15
- data/lib/spec/api/helper/instance_negator.rb +0 -15
- data/lib/spec/api/helper/kind_helper.rb +0 -15
- data/lib/spec/api/helper/kind_negator.rb +0 -15
- data/lib/spec/api/helper/respond_helper.rb +0 -15
- data/lib/spec/api/helper/respond_negator.rb +0 -15
- data/test/spec/api/duck_type_test.rb +0 -19
@@ -1,15 +0,0 @@
|
|
1
|
-
module Spec
|
2
|
-
|
3
|
-
class RespondHelper < ShouldBase
|
4
|
-
|
5
|
-
def initialize(target)
|
6
|
-
@target = target
|
7
|
-
end
|
8
|
-
|
9
|
-
def to(expected)
|
10
|
-
fail_with_message(default_message("should respond to", expected)) unless @target.respond_to? expected
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Spec
|
2
|
-
|
3
|
-
class RespondNegator < ShouldBase
|
4
|
-
|
5
|
-
def initialize(target)
|
6
|
-
@target = target
|
7
|
-
end
|
8
|
-
|
9
|
-
def to(expected)
|
10
|
-
fail_with_message(default_message("should not respond to", expected)) if @target.respond_to? expected
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../test_helper'
|
2
|
-
|
3
|
-
module Spec
|
4
|
-
module Api
|
5
|
-
class DuckTypeTest < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_should_talk_like_something_with_one_message_specified
|
8
|
-
duck_type = DuckTypeArgConstraint.new(:length)
|
9
|
-
assert duck_type.matches?([])
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_should_talk_like_something_with_two_messages_specified
|
13
|
-
duck_type = DuckTypeArgConstraint.new(:length, :empty?)
|
14
|
-
assert duck_type.matches?([])
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|