rspec 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/CHANGES +12 -0
  2. data/EXAMPLES.rd +1 -1
  3. data/Rakefile +1 -0
  4. data/examples/auto_spec_description_example.rb +1 -1
  5. data/examples/before_and_after_example.rb +1 -1
  6. data/examples/behave_as_example.rb +1 -1
  7. data/examples/dynamic_spec.rb +1 -1
  8. data/examples/file_accessor.rb +18 -18
  9. data/examples/file_accessor_spec.rb +38 -38
  10. data/examples/greeter_spec.rb +1 -1
  11. data/examples/helper_method_example.rb +1 -1
  12. data/examples/io_processor.rb +8 -8
  13. data/examples/io_processor_spec.rb +1 -1
  14. data/examples/legacy_spec.rb +1 -1
  15. data/examples/not_yet_implemented_spec.rb +1 -1
  16. data/examples/partial_mock_example.rb +1 -1
  17. data/examples/predicate_example.rb +1 -1
  18. data/examples/stack.rb +1 -1
  19. data/examples/stack_spec.rb +1 -1
  20. data/examples/stubbing_example.rb +1 -1
  21. data/examples/test_case_adapter_example.rb +1 -1
  22. data/lib/autotest/discover.rb +1 -1
  23. data/lib/autotest/rspec.rb +15 -16
  24. data/lib/spec.rb +1 -1
  25. data/lib/spec/dsl/behaviour.rb +1 -0
  26. data/lib/spec/dsl/configuration.rb +1 -1
  27. data/lib/spec/dsl/description.rb +1 -1
  28. data/lib/spec/expectations.rb +1 -1
  29. data/lib/spec/expectations/extensions/string_and_symbol.rb +1 -1
  30. data/lib/spec/extensions/object.rb +1 -1
  31. data/lib/spec/matchers.rb +1 -1
  32. data/lib/spec/matchers/be_close.rb +1 -1
  33. data/lib/spec/matchers/eql.rb +1 -1
  34. data/lib/spec/matchers/equal.rb +1 -1
  35. data/lib/spec/matchers/have.rb +7 -2
  36. data/lib/spec/mocks.rb +1 -1
  37. data/lib/spec/mocks/argument_constraint_matchers.rb +1 -1
  38. data/lib/spec/mocks/error_generator.rb +1 -1
  39. data/lib/spec/mocks/methods.rb +1 -1
  40. data/lib/spec/mocks/mock.rb +1 -1
  41. data/lib/spec/mocks/proxy.rb +1 -1
  42. data/lib/spec/mocks/space.rb +1 -1
  43. data/lib/spec/mocks/spec_methods.rb +1 -1
  44. data/lib/spec/rake/verify_rcov.rb +1 -1
  45. data/lib/spec/runner/backtrace_tweaker.rb +1 -1
  46. data/lib/spec/runner/behaviour_runner.rb +1 -1
  47. data/lib/spec/runner/command_line.rb +1 -1
  48. data/lib/spec/runner/drb_command_line.rb +1 -1
  49. data/lib/spec/runner/formatter/failing_behaviours_formatter.rb +1 -1
  50. data/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
  51. data/lib/spec/runner/formatter/progress_bar_formatter.rb +1 -1
  52. data/lib/spec/runner/formatter/rdoc_formatter.rb +1 -1
  53. data/lib/spec/runner/formatter/snippet_extractor.rb +1 -1
  54. data/lib/spec/runner/heckle_runner_unsupported.rb +10 -10
  55. data/lib/spec/runner/spec_parser.rb +1 -1
  56. data/lib/spec/test_case_adapter.rb +1 -1
  57. data/lib/spec/translator.rb +106 -106
  58. data/lib/spec/version.rb +22 -22
  59. data/spec/spec/dsl/behaviour_factory_spec.rb +1 -1
  60. data/spec/spec/dsl/configuration_spec.rb +1 -1
  61. data/spec/spec/dsl/description_spec.rb +1 -1
  62. data/spec/spec/dsl/predicate_matcher_spec.rb +1 -1
  63. data/spec/spec/dsl/shared_behaviour_spec.rb +19 -6
  64. data/spec/spec/matchers/description_generation_spec.rb +1 -1
  65. data/spec/spec/matchers/exist_spec.rb +1 -1
  66. data/spec/spec/matchers/handler_spec.rb +1 -1
  67. data/spec/spec/matchers/have_spec.rb +14 -1
  68. data/spec/spec/matchers/mock_constraint_matchers_spec.rb +1 -1
  69. data/spec/spec/matchers/respond_to_spec.rb +1 -1
  70. data/spec/spec/mocks/any_number_of_times_spec.rb +1 -1
  71. data/spec/spec/mocks/at_least_spec.rb +1 -1
  72. data/spec/spec/mocks/at_most_spec.rb +1 -1
  73. data/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
  74. data/spec/spec/mocks/bug_report_7805_spec.rb +1 -1
  75. data/spec/spec/mocks/bug_report_8165_spec.rb +1 -1
  76. data/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
  77. data/spec/spec/mocks/mock_ordering_spec.rb +1 -1
  78. data/spec/spec/mocks/once_counts_spec.rb +1 -1
  79. data/spec/spec/mocks/partial_mock_spec.rb +1 -1
  80. data/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +1 -1
  81. data/spec/spec/mocks/precise_counts_spec.rb +1 -1
  82. data/spec/spec/mocks/record_messages_spec.rb +1 -1
  83. data/spec/spec/mocks/stub_spec.rb +1 -1
  84. data/spec/spec/mocks/twice_counts_spec.rb +1 -1
  85. data/spec/spec/package/bin_spec_spec.rb +1 -1
  86. data/spec/spec/runner/context_matching_spec.rb +1 -1
  87. data/spec/spec/runner/example_matcher_spec.rb +1 -1
  88. data/spec/spec/runner/formatter/failing_behaviours_formatter_spec.rb +1 -1
  89. data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +1 -1
  90. data/spec/spec/runner/formatter/html_formatter_spec.rb +0 -2
  91. data/spec/spec/runner/formatter/progress_bar_formatter_dry_run_spec.rb +1 -1
  92. data/spec/spec/runner/formatter/progress_bar_formatter_failure_dump_spec.rb +1 -1
  93. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +1 -1
  94. data/spec/spec/runner/formatter/rdoc_formatter_dry_run_spec.rb +1 -1
  95. data/spec/spec/runner/formatter/rdoc_formatter_spec.rb +1 -1
  96. data/spec/spec/runner/formatter/snippet_extractor_spec.rb +1 -1
  97. data/spec/spec/runner/formatter/specdoc_formatter_dry_run_spec.rb +1 -1
  98. data/spec/spec/runner/heckle_runner_spec.rb +1 -1
  99. data/spec/spec/runner/heckler_spec.rb +1 -1
  100. data/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +1 -1
  101. data/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +1 -1
  102. data/spec/spec/runner/reporter_spec.rb +1 -1
  103. data/spec/spec/runner/spec_parser_spec.rb +1 -1
  104. data/spec/spec/translator_spec.rb +1 -1
  105. data/spec/spec_helper.rb +0 -29
  106. metadata +3 -4
  107. data/lib/autotest.rb +0 -1
@@ -156,4 +156,4 @@ describe "Matchers should be able to generate their own descriptions" do
156
156
  after(:each) do
157
157
  Spec::Matchers.unregister_description_generated(@callback)
158
158
  end
159
- end
159
+ end
@@ -45,4 +45,4 @@ describe "should_not exist" do
45
45
  should fail
46
46
  end
47
47
  end
48
-
48
+
@@ -85,4 +85,4 @@ module Spec
85
85
 
86
86
  end
87
87
  end
88
- end
88
+ end
@@ -47,6 +47,19 @@ describe "should have(n).items" do
47
47
  end
48
48
  end
49
49
 
50
+ describe "should have(n).items where result responds to items but returns something other than a collection" do
51
+ it "should provide a meaningful error" do
52
+ owner = Class.new do
53
+ def items
54
+ Object.new
55
+ end
56
+ end.new
57
+ lambda do
58
+ owner.should have(3).items
59
+ end.should raise_error(RuntimeError, "expected items to be a collection but it does not respond to #length or #size")
60
+ end
61
+ end
62
+
50
63
  describe "should_not have(n).items" do
51
64
  include HaveSpecHelper
52
65
 
@@ -256,4 +269,4 @@ describe "have(n).things on an object which is not a collection nor contains one
256
269
  it "should fail" do
257
270
  lambda { Object.new.should have(2).things }.should raise_error(NoMethodError, /undefined method `things' for #<Object:/)
258
271
  end
259
- end
272
+ end
@@ -21,4 +21,4 @@ end
21
21
  describe "The an_instance_of() mock argument constraint matcher" do
22
22
  # NOTE - this is implemented as a predicate_matcher - see behaviour.rb
23
23
  specify { an_instance_of(String).should == "string" }
24
- end
24
+ end
@@ -51,4 +51,4 @@ describe "should_not respond_to(:sym)" do
51
51
  }.should fail_with("expected target not to respond to :methods")
52
52
  end
53
53
 
54
- end
54
+ end
@@ -26,4 +26,4 @@ module Spec
26
26
  end
27
27
 
28
28
  end
29
- end
29
+ end
@@ -94,4 +94,4 @@ module Spec
94
94
  end
95
95
  end
96
96
  end
97
- end
97
+ end
@@ -90,4 +90,4 @@ module Spec
90
90
  end
91
91
  end
92
92
  end
93
- end
93
+ end
@@ -16,4 +16,4 @@ module Bug7611
16
16
  Bar.new.class.should == Bar
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -19,4 +19,4 @@ module Bug7805
19
19
  end
20
20
  end
21
21
 
22
- end
22
+ end
@@ -28,4 +28,4 @@ describe "An object where respond_to? is true and does not have method" do
28
28
  obj.foobar.should == :baz
29
29
  end
30
30
 
31
- end
31
+ end
@@ -23,4 +23,4 @@ module Bug8302
23
23
  foo.instance_bar(Array.new)
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -81,4 +81,4 @@ module Spec
81
81
 
82
82
  end
83
83
  end
84
- end
84
+ end
@@ -50,4 +50,4 @@ module Spec
50
50
  end
51
51
  end
52
52
  end
53
- end
53
+ end
@@ -49,4 +49,4 @@ module Spec
49
49
 
50
50
  end
51
51
  end
52
- end
52
+ end
@@ -63,4 +63,4 @@ describe "PartialMockUsingMocksDirectly" do
63
63
 
64
64
  end
65
65
  end
66
- end
66
+ end
@@ -49,4 +49,4 @@ module Spec
49
49
  end
50
50
  end
51
51
  end
52
- end
52
+ end
@@ -23,4 +23,4 @@ module Spec
23
23
  end
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -156,4 +156,4 @@ module Spec
156
156
  end
157
157
  end
158
158
  end
159
- end
159
+ end
@@ -64,4 +64,4 @@ module Spec
64
64
  end
65
65
  end
66
66
  end
67
- end
67
+ end
@@ -9,4 +9,4 @@ describe "The bin/spec script" do
9
9
  end
10
10
  output.should_not =~ /warning/n
11
11
  end
12
- end
12
+ end
@@ -24,4 +24,4 @@ module Spec
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -124,4 +124,4 @@ module Spec
124
124
  end
125
125
 
126
126
  end
127
- end
127
+ end
@@ -24,4 +24,4 @@ EOF
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -25,4 +25,4 @@ EOF
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -1,8 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../../../spec_helper.rb'
2
2
 
3
3
  describe "HtmlFormatter" do
4
- it_should_behave_like "Examples that have to load files"
5
-
6
4
  ['--diff', '--dry-run'].each do |opt|
7
5
  it "should produce HTML identical to the one we designed manually with #{opt}" do
8
6
  root = File.expand_path(File.dirname(__FILE__) + '/../../../..')
@@ -18,4 +18,4 @@ describe "ProgressBarFormatterDryRun" do
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -33,4 +33,4 @@ module Spec
33
33
  end
34
34
  end
35
35
  end
36
- end
36
+ end
@@ -75,4 +75,4 @@ EOE
75
75
  end
76
76
  end
77
77
  end
78
- end
78
+ end
@@ -16,4 +16,4 @@ describe "RdocFormatterDryRun" do
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -43,4 +43,4 @@ describe "RdocFormatter" do
43
43
  end
44
44
  end
45
45
  end
46
- end
46
+ end
@@ -8,4 +8,4 @@ describe Spec::Runner::Formatter::SnippetExtractor do
8
8
  it "should fall back on a default message when it doesn't find the file" do
9
9
  Spec::Runner::Formatter::SnippetExtractor.new.lines_around("blech", 8).should == "# Couldn't get snippet for blech"
10
10
  end
11
- end
11
+ end
@@ -18,4 +18,4 @@ describe "SpecdocFormatterDryRun" do
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -60,4 +60,4 @@ unless [/mswin/, /java/].detect{|p| p =~ RUBY_PLATFORM}
60
60
  heckle_runner.heckle_with(behaviour_runner)
61
61
  end
62
62
  end
63
- end
63
+ end
@@ -11,4 +11,4 @@ unless [/mswin/, /java/].detect{|p| p =~ RUBY_PLATFORM}
11
11
  heckler.tests_pass?
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -42,4 +42,4 @@ module Spec
42
42
 
43
43
  end
44
44
  end
45
- end
45
+ end
@@ -53,4 +53,4 @@ module Spec
53
53
  end
54
54
  end
55
55
  end
56
- end
56
+ end
@@ -150,4 +150,4 @@ module Spec
150
150
  end
151
151
  end
152
152
  end
153
- end
153
+ end
@@ -90,4 +90,4 @@ describe "SpecParser" do
90
90
  @p.spec_name_for(File.open(__FILE__), 36).should == "SpecParserSubject described 6"
91
91
  end
92
92
 
93
- end
93
+ end
@@ -213,4 +213,4 @@ describe "Translator" do
213
213
  "controller.should redirect_to('http://not_existing_domain_for_novalis.test.host/404.html')"
214
214
  )
215
215
  end
216
- end
216
+ end
@@ -41,32 +41,3 @@ module Spec
41
41
  end
42
42
  end
43
43
  end
44
-
45
- # There are some examples that need to load the same files repeatedly.
46
- # Requiring spec files instead of loading them (see http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10814&group_id=797),
47
- # caused these specs to fail.
48
- #
49
- # This shared behaviour solves that problem by redefining the behaviour of
50
- # load_specs only for those examples.
51
- unless defined?(RSPEC_EXAMPLES_THAT_LOAD_FILES)
52
- RSPEC_EXAMPLES_THAT_LOAD_FILES = describe "Examples that have to load files", :shared => true do
53
- before(:all) do
54
- Spec::Runner::BehaviourRunner.class_eval do
55
- alias_method :orig_load_specs, :load_specs
56
- def load_specs(paths)
57
- paths.each do |path|
58
- load path
59
- end
60
- end
61
- end
62
- end
63
-
64
- after(:all) do
65
- Spec::Runner::BehaviourRunner.class_eval do
66
- undef :load_specs
67
- alias_method :load_specs, :orig_load_specs
68
- undef :orig_load_specs
69
- end
70
- end
71
- end
72
- end
metadata CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: rspec
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.4
7
- date: 2007-05-29 00:00:00 -04:00
8
- summary: RSpec-1.0.4 (r2054) - BDD for Ruby http://rspec.rubyforge.org/
6
+ version: 1.0.5
7
+ date: 2007-06-05 00:00:00 -05:00
8
+ summary: RSpec-1.0.5 (r2081) - BDD for Ruby http://rspec.rubyforge.org/
9
9
  require_paths:
10
10
  - lib
11
11
  email: rspec-devel@rubyforge.org
@@ -37,7 +37,6 @@ files:
37
37
  - UPGRADE
38
38
  - lib/autotest/discover.rb
39
39
  - lib/autotest/rspec.rb
40
- - lib/autotest.rb
41
40
  - lib/spec/dsl/behaviour.rb
42
41
  - lib/spec/dsl/behaviour_callbacks.rb
43
42
  - lib/spec/dsl/behaviour_eval.rb
@@ -1 +0,0 @@
1
- require File.dirname(__FILE__) + "/autotest/rspec"