rspec 0.9.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/CHANGES +24 -0
  2. data/EXAMPLES.rd +6 -2
  3. data/README +9 -9
  4. data/Rakefile +32 -29
  5. data/examples/not_yet_implemented_spec.rb +12 -0
  6. data/examples/shared_behaviours_example.rb +8 -0
  7. data/examples/stack_spec.rb +1 -0
  8. data/lib/spec/dsl/behaviour.rb +21 -6
  9. data/lib/spec/dsl/behaviour_callbacks.rb +44 -26
  10. data/lib/spec/dsl/behaviour_eval.rb +21 -12
  11. data/lib/spec/dsl/behaviour_factory.rb +23 -13
  12. data/lib/spec/dsl/configuration.rb +85 -5
  13. data/lib/spec/dsl/description.rb +14 -6
  14. data/lib/spec/dsl/example.rb +2 -2
  15. data/lib/spec/matchers.rb +5 -5
  16. data/lib/spec/matchers/be.rb +16 -0
  17. data/lib/spec/matchers/operator_matcher.rb +21 -1
  18. data/lib/spec/matchers/raise_error.rb +1 -1
  19. data/lib/spec/rake/verify_rcov.rb +5 -1
  20. data/lib/spec/runner.rb +7 -27
  21. data/lib/spec/runner/behaviour_runner.rb +1 -1
  22. data/lib/spec/runner/extensions/kernel.rb +20 -0
  23. data/lib/spec/runner/formatter/base_formatter.rb +6 -1
  24. data/lib/spec/runner/formatter/base_text_formatter.rb +10 -2
  25. data/lib/spec/runner/formatter/failing_behaviours_formatter.rb +1 -1
  26. data/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
  27. data/lib/spec/runner/formatter/html_formatter.rb +63 -31
  28. data/lib/spec/runner/formatter/progress_bar_formatter.rb +5 -0
  29. data/lib/spec/runner/formatter/rdoc_formatter.rb +4 -0
  30. data/lib/spec/runner/formatter/specdoc_formatter.rb +6 -1
  31. data/lib/spec/runner/option_parser.rb +1 -1
  32. data/lib/spec/runner/reporter.rb +13 -4
  33. data/lib/spec/runner/spec_parser.rb +1 -1
  34. data/lib/spec/version.rb +5 -5
  35. data/spec/spec/dsl/behaviour_spec.rb +88 -24
  36. data/spec/spec/dsl/configuration_spec.rb +8 -1
  37. data/spec/spec/dsl/example_class_spec.rb +1 -1
  38. data/spec/spec/dsl/example_instance_spec.rb +5 -5
  39. data/spec/spec/dsl/shared_behaviour_spec.rb +24 -2
  40. data/spec/spec/matchers/be_spec.rb +20 -2
  41. data/spec/spec/matchers/operator_matcher_spec.rb +158 -0
  42. data/spec/spec/runner/command_line_spec.rb +5 -4
  43. data/spec/spec/runner/drb_command_line_spec.rb +15 -8
  44. data/spec/spec/runner/formatter/html_formatter_spec.rb +22 -5
  45. data/spec/spec/runner/formatter/progress_bar_formatter_dry_run_spec.rb +1 -1
  46. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +7 -2
  47. data/spec/spec/runner/formatter/rdoc_formatter_dry_run_spec.rb +1 -1
  48. data/spec/spec/runner/formatter/rdoc_formatter_spec.rb +6 -1
  49. data/spec/spec/runner/formatter/specdoc_formatter_dry_run_spec.rb +1 -1
  50. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +15 -5
  51. data/spec/spec/runner/option_parser_spec.rb +5 -0
  52. data/spec/spec/runner/reporter_spec.rb +23 -5
  53. data/spec/spec/runner/spec_matcher_spec.rb +1 -1
  54. data/spec/spec/runner/spec_parser_spec.rb +1 -1
  55. data/spec/spec_helper.rb +38 -2
  56. metadata +41 -42
  57. data/spec/spec/matchers/should_===_spec.rb +0 -38
  58. data/spec/spec/matchers/should_==_spec.rb +0 -37
  59. 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
-