rspec 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/CHANGES +35 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README +9 -44
  4. data/Rakefile +34 -51
  5. data/TODO +0 -1
  6. data/UPGRADE +0 -24
  7. data/bin/spec +0 -0
  8. data/bin/spec_translator +0 -0
  9. data/examples/pure/behave_as_example.rb +0 -0
  10. data/examples/pure/partial_mock_example.rb +1 -0
  11. data/examples/stories/calculator.rb +1 -1
  12. data/lib/autotest/rspec.rb +7 -9
  13. data/lib/spec/example.rb +1 -1
  14. data/lib/spec/example/configuration.rb +30 -16
  15. data/lib/spec/example/example_group.rb +2 -1
  16. data/lib/spec/example/example_group_factory.rb +23 -21
  17. data/lib/spec/example/example_group_methods.rb +18 -5
  18. data/lib/spec/example/example_matcher.rb +0 -0
  19. data/lib/spec/example/example_methods.rb +6 -0
  20. data/lib/spec/example/module_inclusion_warnings.rb +37 -0
  21. data/lib/spec/expectations/differs/default.rb +1 -1
  22. data/lib/spec/expectations/extensions/object.rb +4 -12
  23. data/lib/spec/expectations/handler.rb +8 -0
  24. data/lib/spec/extensions.rb +1 -0
  25. data/lib/spec/extensions/metaclass.rb +7 -0
  26. data/lib/spec/extensions/object.rb +0 -4
  27. data/lib/spec/matchers/change.rb +1 -1
  28. data/lib/spec/matchers/has.rb +1 -11
  29. data/lib/spec/matchers/operator_matcher.rb +0 -0
  30. data/lib/spec/matchers/raise_error.rb +53 -30
  31. data/lib/spec/mocks.rb +1 -1
  32. data/lib/spec/mocks/argument_constraint_matchers.rb +5 -1
  33. data/lib/spec/mocks/argument_expectation.rb +26 -0
  34. data/lib/spec/mocks/extensions.rb +1 -0
  35. data/lib/spec/mocks/framework.rb +15 -0
  36. data/lib/spec/mocks/message_expectation.rb +29 -5
  37. data/lib/spec/mocks/mock.rb +9 -7
  38. data/lib/spec/mocks/proxy.rb +26 -12
  39. data/lib/spec/rake/spectask.rb +5 -5
  40. data/lib/spec/runner/backtrace_tweaker.rb +1 -1
  41. data/lib/spec/runner/formatter/base_formatter.rb +2 -3
  42. data/lib/spec/runner/formatter/base_text_formatter.rb +2 -2
  43. data/lib/spec/runner/formatter/failing_example_groups_formatter.rb +4 -8
  44. data/lib/spec/runner/formatter/html_formatter.rb +18 -14
  45. data/lib/spec/runner/formatter/nested_text_formatter.rb +65 -0
  46. data/lib/spec/runner/formatter/profile_formatter.rb +4 -0
  47. data/lib/spec/runner/formatter/progress_bar_formatter.rb +5 -1
  48. data/lib/spec/runner/formatter/specdoc_formatter.rb +1 -1
  49. data/lib/spec/runner/formatter/story/plain_text_formatter.rb +18 -7
  50. data/lib/spec/runner/option_parser.rb +17 -15
  51. data/lib/spec/runner/options.rb +37 -14
  52. data/lib/spec/runner/reporter.rb +15 -11
  53. data/lib/spec/story/extensions/regexp.rb +2 -2
  54. data/lib/spec/story/extensions/string.rb +2 -2
  55. data/lib/spec/story/runner.rb +9 -5
  56. data/lib/spec/story/runner/plain_text_story_runner.rb +2 -2
  57. data/lib/spec/story/runner/scenario_runner.rb +8 -0
  58. data/lib/spec/story/runner/story_mediator.rb +1 -1
  59. data/lib/spec/story/runner/story_runner.rb +3 -1
  60. data/lib/spec/story/step.rb +4 -4
  61. data/lib/spec/story/story.rb +8 -11
  62. data/lib/spec/story/world.rb +0 -1
  63. data/lib/spec/version.rb +2 -2
  64. data/plugins/mock_frameworks/rspec.rb +2 -0
  65. data/spec/autotest/rspec_spec.rb +12 -10
  66. data/spec/spec/example/configuration_spec.rb +0 -0
  67. data/spec/spec/example/example_group/described_module_spec.rb +20 -0
  68. data/spec/spec/example/example_group/warning_messages_spec.rb +76 -0
  69. data/spec/spec/example/example_group_factory_spec.rb +117 -102
  70. data/spec/spec/example/example_group_methods_spec.rb +51 -17
  71. data/spec/spec/example/example_group_spec.rb +13 -1
  72. data/spec/spec/example/example_methods_spec.rb +28 -6
  73. data/spec/spec/example/nested_example_group_spec.rb +12 -0
  74. data/spec/spec/example/predicate_matcher_spec.rb +0 -0
  75. data/spec/spec/expectations/differs/default_spec.rb +27 -9
  76. data/spec/spec/matchers/be_spec.rb +24 -0
  77. data/spec/spec/matchers/has_spec.rb +16 -0
  78. data/spec/spec/matchers/raise_error_spec.rb +124 -0
  79. data/spec/spec/mocks/{bug_report_10263.rb → bug_report_10263_spec.rb} +0 -0
  80. data/spec/spec/mocks/bug_report_11545_spec.rb +2 -0
  81. data/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +8 -0
  82. data/spec/spec/mocks/hash_including_matcher_spec.rb +32 -0
  83. data/spec/spec/mocks/mock_spec.rb +56 -37
  84. data/spec/spec/mocks/partial_mock_spec.rb +41 -5
  85. data/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +6 -0
  86. data/spec/spec/runner/execution_context_spec.rb +7 -1
  87. data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +3 -2
  88. data/spec/spec/runner/formatter/html_formatted-1.8.6.html +30 -25
  89. data/spec/spec/runner/formatter/html_formatter_spec.rb +0 -3
  90. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +333 -0
  91. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +12 -2
  92. data/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +2 -2
  93. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +110 -78
  94. data/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +105 -1
  95. data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +33 -28
  96. data/spec/spec/runner/option_parser_spec.rb +65 -49
  97. data/spec/spec/runner/options_spec.rb +103 -17
  98. data/spec/spec/runner/reporter_spec.rb +10 -7
  99. data/spec/spec/runner/spec_drb.opts +1 -0
  100. data/spec/spec/runner/spec_parser_spec.rb +10 -4
  101. data/spec/spec/story/runner/plain_text_story_runner_spec.rb +14 -13
  102. data/spec/spec/story/runner/scenario_runner_spec.rb +124 -52
  103. data/spec/spec/story/runner/story_mediator_spec.rb +2 -2
  104. data/spec/spec/story/runner/story_runner_spec.rb +40 -2
  105. data/spec/spec/story/runner_spec.rb +59 -72
  106. data/spec/spec/story/step_spec.rb +20 -1
  107. data/spec/spec/story/story_spec.rb +2 -2
  108. data/stories/all.rb +1 -1
  109. data/stories/example_groups/stories.rb +4 -3
  110. data/stories/mock_framework_integration/stories.rb +7 -0
  111. data/stories/mock_framework_integration/use_flexmock.story +9 -0
  112. data/stories/resources/spec/spec_with_flexmock.rb +18 -0
  113. metadata +21 -18
  114. data/pre_commit/lib/pre_commit.rb +0 -4
  115. data/pre_commit/lib/pre_commit/core.rb +0 -50
  116. data/pre_commit/lib/pre_commit/pre_commit.rb +0 -54
  117. data/pre_commit/lib/pre_commit/rspec.rb +0 -111
  118. data/pre_commit/lib/pre_commit/rspec_on_rails.rb +0 -313
  119. data/pre_commit/spec/pre_commit/pre_commit_spec.rb +0 -15
  120. data/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +0 -36
  121. data/pre_commit/spec/spec_helper.rb +0 -3
  122. data/pre_commit/spec/spec_suite.rb +0 -11
@@ -1,15 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
-
3
- ##
4
- # This is not a complete specification of PreCommit, but
5
- # just a collection of bug fix regression tests.
6
- describe "The helper method PreCommit#silent_sh" do
7
- before do
8
- @pre_commit = PreCommit.new(nil)
9
- end
10
-
11
- # bug in r1802
12
- it "should return the command output" do
13
- @pre_commit.send(:silent_sh, "echo foo").should ==("foo\n")
14
- end
15
- end
@@ -1,36 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper.rb'
2
- require 'fileutils'
3
-
4
- include FileUtils
5
-
6
- ##
7
- # This is not a complete specification of PreCommit.RSpecOnRails, but
8
- # just a collection of bug fix regression tests.
9
- describe "RSpecOnRails pre_commit" do
10
- before do
11
- @original_dir = File.expand_path(FileUtils.pwd)
12
- @rails_app_dir = File.expand_path(File.dirname(__FILE__) + "/../../../example_rails_app/")
13
-
14
- Dir.chdir(@rails_app_dir)
15
- rm_rf('vendor/plugins/rspec_on_rails')
16
- system("svn export ../rspec_on_rails vendor/plugins/rspec_on_rails")
17
-
18
- @pre_commit = PreCommit::RspecOnRails.new(nil)
19
- end
20
-
21
- after do
22
- rm('db/migrate/888_create_purchases.rb', :force => true)
23
- @pre_commit.destroy_purchase
24
- Dir.chdir(@original_dir)
25
- end
26
-
27
- # bug in r1802
28
- it "should fail noisily if there is a migration name conflict" do
29
- touch('db/migrate/888_create_purchases.rb')
30
- lambda { @pre_commit.generate_purchase }.should raise_error
31
- end
32
-
33
- it "should not fail if tests run ok" do
34
- lambda { @pre_commit.generate_purchase }.should_not raise_error
35
- end
36
- end
@@ -1,3 +0,0 @@
1
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
2
- require 'pre_commit'
3
-
@@ -1,11 +0,0 @@
1
- class SpecSuite
2
- def run
3
- system("ruby rspec/spec/rspec_suite.rb") || raise("Rspec Suite FAILED")
4
- system("ruby rspec_on_rails/spec/rails_suite.rb") || raise("Rails Suite FAILED")
5
- system("ruby cached_example_rails_app/spec/rails_app_suite.rb") || raise("Rails App Suite FAILED")
6
- end
7
- end
8
-
9
- if $0 == __FILE__
10
- SpecSuite.new.run
11
- end