rspec 0.9.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +24 -0
- data/EXAMPLES.rd +6 -2
- data/README +9 -9
- data/Rakefile +32 -29
- data/examples/not_yet_implemented_spec.rb +12 -0
- data/examples/shared_behaviours_example.rb +8 -0
- data/examples/stack_spec.rb +1 -0
- data/lib/spec/dsl/behaviour.rb +21 -6
- data/lib/spec/dsl/behaviour_callbacks.rb +44 -26
- data/lib/spec/dsl/behaviour_eval.rb +21 -12
- data/lib/spec/dsl/behaviour_factory.rb +23 -13
- data/lib/spec/dsl/configuration.rb +85 -5
- data/lib/spec/dsl/description.rb +14 -6
- data/lib/spec/dsl/example.rb +2 -2
- data/lib/spec/matchers.rb +5 -5
- data/lib/spec/matchers/be.rb +16 -0
- data/lib/spec/matchers/operator_matcher.rb +21 -1
- data/lib/spec/matchers/raise_error.rb +1 -1
- data/lib/spec/rake/verify_rcov.rb +5 -1
- data/lib/spec/runner.rb +7 -27
- data/lib/spec/runner/behaviour_runner.rb +1 -1
- data/lib/spec/runner/extensions/kernel.rb +20 -0
- data/lib/spec/runner/formatter/base_formatter.rb +6 -1
- data/lib/spec/runner/formatter/base_text_formatter.rb +10 -2
- data/lib/spec/runner/formatter/failing_behaviours_formatter.rb +1 -1
- data/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
- data/lib/spec/runner/formatter/html_formatter.rb +63 -31
- data/lib/spec/runner/formatter/progress_bar_formatter.rb +5 -0
- data/lib/spec/runner/formatter/rdoc_formatter.rb +4 -0
- data/lib/spec/runner/formatter/specdoc_formatter.rb +6 -1
- data/lib/spec/runner/option_parser.rb +1 -1
- data/lib/spec/runner/reporter.rb +13 -4
- data/lib/spec/runner/spec_parser.rb +1 -1
- data/lib/spec/version.rb +5 -5
- data/spec/spec/dsl/behaviour_spec.rb +88 -24
- data/spec/spec/dsl/configuration_spec.rb +8 -1
- data/spec/spec/dsl/example_class_spec.rb +1 -1
- data/spec/spec/dsl/example_instance_spec.rb +5 -5
- data/spec/spec/dsl/shared_behaviour_spec.rb +24 -2
- data/spec/spec/matchers/be_spec.rb +20 -2
- data/spec/spec/matchers/operator_matcher_spec.rb +158 -0
- data/spec/spec/runner/command_line_spec.rb +5 -4
- data/spec/spec/runner/drb_command_line_spec.rb +15 -8
- data/spec/spec/runner/formatter/html_formatter_spec.rb +22 -5
- data/spec/spec/runner/formatter/progress_bar_formatter_dry_run_spec.rb +1 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +7 -2
- data/spec/spec/runner/formatter/rdoc_formatter_dry_run_spec.rb +1 -1
- data/spec/spec/runner/formatter/rdoc_formatter_spec.rb +6 -1
- data/spec/spec/runner/formatter/specdoc_formatter_dry_run_spec.rb +1 -1
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +15 -5
- data/spec/spec/runner/option_parser_spec.rb +5 -0
- data/spec/spec/runner/reporter_spec.rb +23 -5
- data/spec/spec/runner/spec_matcher_spec.rb +1 -1
- data/spec/spec/runner/spec_parser_spec.rb +1 -1
- data/spec/spec_helper.rb +38 -2
- metadata +41 -42
- data/spec/spec/matchers/should_===_spec.rb +0 -38
- data/spec/spec/matchers/should_==_spec.rb +0 -37
- data/spec/spec/matchers/should_=~_spec.rb +0 -36
@@ -1,37 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
-
|
3
|
-
require 'spec/expectations/differs/default'
|
4
|
-
|
5
|
-
describe "should ==" do
|
6
|
-
|
7
|
-
it "should delegate message to target" do
|
8
|
-
subject = "apple"
|
9
|
-
subject.should_receive(:==).with("apple").and_return(true)
|
10
|
-
subject.should == "apple"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should fail when target.==(actual) returns false" do
|
14
|
-
subject = "apple"
|
15
|
-
Spec::Expectations.should_receive(:fail_with).with(%[expected "orange", got "apple" (using ==)], "orange", "apple")
|
16
|
-
subject.should == "orange"
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "should_not ==" do
|
22
|
-
|
23
|
-
it "should delegate message to target" do
|
24
|
-
subject = "orange"
|
25
|
-
subject.should_receive(:==).with("apple").and_return(false)
|
26
|
-
subject.should_not == "apple"
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should fail when target.==(actual) returns false" do
|
30
|
-
subject = "apple"
|
31
|
-
Spec::Expectations.should_receive(:fail_with).with(%[expected not == "apple", got "apple"], "apple", "apple")
|
32
|
-
subject.should_not == "apple"
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
-
|
3
|
-
describe "should =~" do
|
4
|
-
|
5
|
-
it "should delegate message to target" do
|
6
|
-
subject = "foo"
|
7
|
-
subject.should_receive(:=~).with(/oo/).and_return(true)
|
8
|
-
subject.should =~ /oo/
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should fail when target.=~(actual) returns false" do
|
12
|
-
subject = "fu"
|
13
|
-
subject.should_receive(:=~).with(/oo/).and_return(false)
|
14
|
-
Spec::Expectations.should_receive(:fail_with).with(%[expected =~ /oo/, got "fu"], /oo/, "fu")
|
15
|
-
subject.should =~ /oo/
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "should_not =~" do
|
21
|
-
|
22
|
-
it "should delegate message to target" do
|
23
|
-
subject = "fu"
|
24
|
-
subject.should_receive(:=~).with(/oo/).and_return(false)
|
25
|
-
subject.should_not =~ /oo/
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should fail when target.=~(actual) returns false" do
|
29
|
-
subject = "foo"
|
30
|
-
subject.should_receive(:=~).with(/oo/).and_return(true)
|
31
|
-
Spec::Expectations.should_receive(:fail_with).with(%[expected not =~ /oo/, got "foo"], /oo/, "foo")
|
32
|
-
subject.should_not =~ /oo/
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|