rspec 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +78 -1
- data/EXAMPLES.rd +8 -5
- data/README +1 -0
- data/Rakefile +1 -1
- data/examples/pending_example.rb +20 -0
- data/lib/autotest/rspec.rb +46 -18
- data/lib/spec/dsl.rb +1 -0
- data/lib/spec/dsl/behaviour.rb +37 -27
- data/lib/spec/dsl/behaviour_callbacks.rb +4 -0
- data/lib/spec/dsl/behaviour_eval.rb +27 -16
- data/lib/spec/dsl/behaviour_factory.rb +2 -2
- data/lib/spec/dsl/composite_proc_builder.rb +9 -4
- data/lib/spec/dsl/configuration.rb +20 -4
- data/lib/spec/dsl/description.rb +7 -0
- data/lib/spec/dsl/errors.rb +9 -0
- data/lib/spec/dsl/example.rb +18 -10
- data/lib/spec/matchers/have.rb +10 -13
- data/lib/spec/matchers/operator_matcher.rb +3 -3
- data/lib/spec/matchers/raise_error.rb +8 -3
- data/lib/spec/mocks/error_generator.rb +1 -1
- data/lib/spec/mocks/message_expectation.rb +11 -0
- data/lib/spec/mocks/methods.rb +9 -5
- data/lib/spec/mocks/proxy.rb +13 -9
- data/lib/spec/rake/spectask.rb +80 -38
- data/lib/spec/runner/backtrace_tweaker.rb +2 -1
- data/lib/spec/runner/behaviour_runner.rb +37 -16
- data/lib/spec/runner/formatter/base_formatter.rb +23 -15
- data/lib/spec/runner/formatter/base_text_formatter.rb +39 -11
- data/lib/spec/runner/formatter/failing_behaviours_formatter.rb +7 -3
- data/lib/spec/runner/formatter/failing_examples_formatter.rb +3 -3
- data/lib/spec/runner/formatter/html_formatter.rb +32 -25
- data/lib/spec/runner/formatter/progress_bar_formatter.rb +6 -5
- data/lib/spec/runner/formatter/rdoc_formatter.rb +6 -6
- data/lib/spec/runner/formatter/specdoc_formatter.rb +7 -6
- data/lib/spec/runner/option_parser.rb +6 -5
- data/lib/spec/runner/options.rb +60 -43
- data/lib/spec/runner/reporter.rb +17 -6
- data/lib/spec/runner/spec_parser.rb +1 -1
- data/lib/spec/translator.rb +8 -0
- data/lib/spec/version.rb +3 -3
- data/plugins/mock_frameworks/flexmock.rb +14 -18
- data/plugins/mock_frameworks/mocha.rb +0 -2
- data/plugins/mock_frameworks/rr.rb +21 -0
- data/spec/autotest/discover_spec.rb +19 -0
- data/spec/autotest/rspec_spec.rb +257 -0
- data/spec/autotest_helper.rb +4 -0
- data/spec/spec/dsl/behaviour_eval_spec.rb +30 -0
- data/spec/spec/dsl/behaviour_factory_spec.rb +18 -0
- data/spec/spec/dsl/behaviour_spec.rb +95 -58
- data/spec/spec/dsl/composite_proc_builder_spec.rb +0 -13
- data/spec/spec/dsl/configuration_spec.rb +6 -1
- data/spec/spec/dsl/description_spec.rb +9 -1
- data/spec/spec/dsl/example_class_spec.rb +3 -3
- data/spec/spec/dsl/example_instance_spec.rb +26 -28
- data/spec/spec/dsl/example_matcher_spec.rb +91 -0
- data/spec/spec/dsl/shared_behaviour_spec.rb +24 -0
- data/spec/spec/expectations/extensions/object_spec.rb +2 -2
- data/spec/spec/expectations/fail_with_spec.rb +2 -2
- data/spec/spec/matchers/have_spec.rb +1 -1
- data/spec/spec/matchers/operator_matcher_spec.rb +10 -10
- data/spec/spec/matchers/raise_error_spec.rb +38 -0
- data/spec/spec/mocks/argument_expectation_spec.rb +18 -14
- data/spec/spec/mocks/at_most_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_11545_spec.rb +31 -0
- data/spec/spec/mocks/partial_mock_spec.rb +33 -1
- data/spec/spec/runner/behaviour_runner_spec.rb +72 -49
- data/spec/spec/runner/command_line_spec.rb +1 -1
- data/spec/spec/runner/context_matching_spec.rb +10 -10
- data/spec/spec/runner/drb_command_line_spec.rb +62 -59
- data/spec/spec/runner/extensions/bug_report_10577_spec.rb +35 -0
- data/spec/spec/runner/formatter/failing_behaviours_formatter_spec.rb +15 -2
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +3 -3
- data/spec/spec/runner/formatter/html_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_dry_run_spec.rb +14 -15
- data/spec/spec/runner/formatter/progress_bar_formatter_failure_dump_spec.rb +1 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +42 -9
- data/spec/spec/runner/formatter/rdoc_formatter_spec.rb +40 -40
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +55 -49
- data/spec/spec/runner/option_parser_spec.rb +16 -15
- data/spec/spec/runner/options_spec.rb +64 -31
- data/spec/spec/runner/reporter_spec.rb +67 -15
- data/spec/spec/spec_classes.rb +9 -1
- data/spec/spec/translator_spec.rb +48 -0
- data/spec/spec_helper.rb +5 -2
- metadata +13 -6
- data/examples/not_yet_implemented_spec.rb +0 -12
- data/spec/spec/runner/example_matcher_spec.rb +0 -127
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
require File.dirname(__FILE__) + "/stack"
|
3
|
-
|
4
|
-
describe Stack, ' (not implemented features)' do
|
5
|
-
before(:each) do
|
6
|
-
@stack = Stack.new
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should transform to xml using #to_xml"
|
10
|
-
|
11
|
-
it "should convert from xml using #from_xml"
|
12
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
-
|
3
|
-
module Spec
|
4
|
-
module DSL
|
5
|
-
module ExampleMatcherSpecHelper
|
6
|
-
class MatchDescription
|
7
|
-
def initialize(description)
|
8
|
-
@description = description
|
9
|
-
end
|
10
|
-
|
11
|
-
def matches?(matcher)
|
12
|
-
matcher.matches?(@description)
|
13
|
-
end
|
14
|
-
|
15
|
-
def failure_message
|
16
|
-
"expected matcher.matches?(#{@description.inspect}) to return true, got false"
|
17
|
-
end
|
18
|
-
|
19
|
-
def negative_failure_message
|
20
|
-
"expected matcher.matches?(#{@description.inspect}) to return false, got true"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
def match_description(description)
|
24
|
-
MatchDescription.new(description)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe ExampleMatcher do
|
29
|
-
include ExampleMatcherSpecHelper
|
30
|
-
|
31
|
-
it "should match correct behaviour and example" do
|
32
|
-
matcher=ExampleMatcher.new("behaviour", "example")
|
33
|
-
matcher.should match_description("behaviour example")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should not match wrong example" do
|
37
|
-
matcher=ExampleMatcher.new("behaviour", "other example")
|
38
|
-
matcher.should_not match_description("behaviour example")
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should not match wrong behaviour" do
|
42
|
-
matcher=ExampleMatcher.new("other behaviour", "example")
|
43
|
-
matcher.should_not match_description("behaviour example")
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should match example only" do
|
47
|
-
matcher=ExampleMatcher.new("behaviour", "example")
|
48
|
-
matcher.should match_description("example")
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should match behaviour only" do
|
52
|
-
matcher=ExampleMatcher.new("behaviour", "example")
|
53
|
-
matcher.should match_description("behaviour")
|
54
|
-
end
|
55
|
-
|
56
|
-
it "should escape regexp chars" do
|
57
|
-
matcher=ExampleMatcher.new("(con|text)", "[example]")
|
58
|
-
matcher.should_not match_description("con p")
|
59
|
-
end
|
60
|
-
|
61
|
-
it "should match when behaviour is modularized" do
|
62
|
-
matcher=ExampleMatcher.new("MyModule::MyClass", "example")
|
63
|
-
matcher.should match_description("MyClass example")
|
64
|
-
end
|
65
|
-
|
66
|
-
# it "should match with regexp reserved (characters) in the example" do
|
67
|
-
# matcher=ExampleMatcher.new("with ([#]) an example", "a context")
|
68
|
-
# matcher.should match_description("a context")
|
69
|
-
# matcher.should match_description("with ([#]) an example")
|
70
|
-
# matcher.should match_description("a context with ([#]) an example")
|
71
|
-
# end
|
72
|
-
#
|
73
|
-
# it "should match with regexp reserved (characters) in the context" do
|
74
|
-
# matcher=ExampleMatcher.new("with an example", "a ([#]) context")
|
75
|
-
# matcher.should match_description("a ([#]) context with an example")
|
76
|
-
# matcher.should match_description("a ([#]) context with an example")
|
77
|
-
# matcher.should match_description("a ([#]) context with an example")
|
78
|
-
# end
|
79
|
-
|
80
|
-
# it "should not match wrong example only" do
|
81
|
-
# matcher=ExampleMatcher.new("with another example", "a context")
|
82
|
-
# matcher.should_not match_description("with an example")
|
83
|
-
# end
|
84
|
-
#
|
85
|
-
# it "should not match wrong context" do
|
86
|
-
# matcher=ExampleMatcher.new("another context with an example", "a context")
|
87
|
-
# matcher.should_not match_description("with an example")
|
88
|
-
# end
|
89
|
-
#
|
90
|
-
# it "should not match wrong context only" do
|
91
|
-
# matcher=ExampleMatcher.new("another context", "a context")
|
92
|
-
# matcher.should_not match_description("with an example")
|
93
|
-
# end
|
94
|
-
#
|
95
|
-
# it "should not match wrong example" do
|
96
|
-
# matcher=ExampleMatcher.new("a context with another example", "a context")
|
97
|
-
# matcher.should_not match_description("with an example")
|
98
|
-
# end
|
99
|
-
|
100
|
-
end
|
101
|
-
|
102
|
-
describe ExampleMatcher, "normal case" do
|
103
|
-
it "matches when passed in example matches" do
|
104
|
-
@matcher = ExampleMatcher.new("Foo", "bar")
|
105
|
-
@matcher.matches?(["no match", "Foo bar"]).should == true
|
106
|
-
end
|
107
|
-
|
108
|
-
it "does not match when no passed in examples match" do
|
109
|
-
@matcher = ExampleMatcher.new("Foo", "bar")
|
110
|
-
@matcher.matches?(["no match1", "no match2"]).should == false
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
describe ExampleMatcher, "where description has '::' in it" do
|
115
|
-
it "matches when passed in example matches" do
|
116
|
-
@matcher = ExampleMatcher.new("Foo::Bar", "baz")
|
117
|
-
@matcher.matches?(["no match", "Foo::Bar baz"]).should == true
|
118
|
-
end
|
119
|
-
|
120
|
-
it "does not match when no passed in examples match" do
|
121
|
-
@matcher = ExampleMatcher.new("Foo::Bar", "baz")
|
122
|
-
@matcher.matches?(["no match1", "no match2"]).should == false
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
end
|
127
|
-
end
|