Permalink
Browse files

Merge branch 'master' into require-rubygems

  • Loading branch information...
2 parents ee96c7f + 7189fd7 commit 326ab10ab50a42f58745b8f6caff989d40dc48cf @dchelimsky dchelimsky committed Apr 2, 2009
Showing with 796 additions and 723 deletions.
  1. +1 −0 .gitignore
  2. +20 −1 History.rdoc
  3. +7 −7 Manifest.txt
  4. +1 −1 Rakefile
  5. +14 −2 Upgrade.rdoc
  6. +20 −21 features/before_and_after_blocks/before_and_after_blocks.feature
  7. +0 −20 features/example_groups/output.feature
  8. +19 −0 features/extensions/custom_example_group.feature
  9. +30 −0 features/formatters/custom_formatter.feature
  10. +7 −7 features/heckle/heckle.feature
  11. +63 −14 features/interop/examples_and_tests_together.feature
  12. +25 −0 features/interop/rspec_output.feature
  13. +19 −6 features/interop/test_but_not_test_unit.feature
  14. +37 −8 features/interop/test_case_with_should_methods.feature
  15. +21 −21 features/matchers/create_matcher.feature
  16. +3 −3 features/matchers/create_matcher_outside_rspec.feature
  17. +3 −3 features/mock_framework_integration/use_flexmock.feature
  18. +3 −3 features/mock_framework_integration/use_mocha.feature
  19. +3 −3 features/mock_framework_integration/use_rr.feature
  20. +4 −4 features/mocks/mix_stubs_and_mocks.feature
  21. +18 −18 features/pending/pending_examples.feature
  22. +32 −0 features/runner/specify_line_number.feature
  23. +0 −69 features/step_definitions/running_rspec.rb
  24. +61 −0 features/step_definitions/running_rspec_steps.rb
  25. +4 −4 features/subject/explicit_subject.feature
  26. +4 −4 features/subject/implicit_subject.feature
  27. +65 −11 features/support/env.rb
  28. +10 −35 features/support/matchers/smart_match.rb
  29. +1 −0 lib/spec/dsl/main.rb
  30. +8 −18 lib/spec/example/errors.rb
  31. +4 −4 lib/spec/example/example_group_methods.rb
  32. +5 −1 lib/spec/example/example_methods.rb
  33. +3 −4 lib/spec/example/pending.rb
  34. +2 −0 lib/spec/example/subject.rb
  35. +1 −1 lib/spec/expectations/extensions.rb
  36. +52 −0 lib/spec/expectations/extensions/kernel.rb
  37. +0 −63 lib/spec/expectations/extensions/object.rb
  38. +3 −3 lib/spec/matchers/be.rb
  39. +2 −2 lib/spec/matchers/simple_matcher.rb
  40. +0 −12 lib/spec/runner/example_group_runner.rb
  41. +10 −22 lib/spec/runner/formatter/base_formatter.rb
  42. +17 −13 lib/spec/runner/formatter/base_text_formatter.rb
  43. +3 −2 lib/spec/runner/formatter/html_formatter.rb
  44. +3 −2 lib/spec/runner/formatter/nested_text_formatter.rb
  45. +1 −1 lib/spec/runner/formatter/progress_bar_formatter.rb
  46. +11 −0 lib/spec/runner/formatter/silent_formatter.rb
  47. +3 −2 lib/spec/runner/formatter/specdoc_formatter.rb
  48. +7 −2 lib/spec/runner/option_parser.rb
  49. +5 −5 lib/spec/runner/options.rb
  50. +8 −8 lib/spec/runner/reporter.rb
  51. +1 −1 lib/spec/version.rb
  52. +0 −8 resources/spec/simple_spec.rb
  53. +0 −56 resources/test/spec_and_test_together.rb
  54. +0 −11 resources/test/spec_including_test_but_not_unit.rb
  55. +0 −29 resources/test/test_case_with_should_methods.rb
  56. +7 −0 spec/spec/dsl/main_spec.rb
  57. +8 −0 spec/spec/example/example_group_methods_spec.rb
  58. +19 −0 spec/spec/example/example_methods_spec.rb
  59. +2 −108 spec/spec/example/pending_module_spec.rb
  60. +9 −9 spec/spec/expectations/extensions/object_spec.rb
  61. +1 −5 spec/spec/matchers/be_spec.rb
  62. +0 −7 spec/spec/runner/example_group_runner_spec.rb
  63. +14 −13 spec/spec/runner/formatter/base_formatter_spec.rb
  64. +1 −1 spec/spec/runner/formatter/progress_bar_formatter_spec.rb
  65. +84 −37 spec/spec/runner/option_parser_spec.rb
  66. +7 −8 spec/spec/runner/reporter_spec.rb
View
@@ -8,3 +8,4 @@ story_server/prototype/rspec_stories.html
*~
email.txt
tmp
+*.sw?
View
@@ -1,3 +1,22 @@
+=== Version 1.2.3 (in git)
+
+* enhancements
+
+ * support for specifying single examples with colon syntax. Closes #712.
+ (Ben Mabey)
+ * you can now say "spec some_spec.rb:12" in addition to "spec some_spec.rb
+ --line 12"
+ * changed add_example_group to example_group_started in formatters
+ * example_group_started is an alias for now, so nothing should break
+ * will deprecate eventually, so if you have custom formatters, we
+ recommend making the change now.
+ * deprecated the third argument to example_pending. See
+ Spec::Runner::Formatter::BaseFormatter for more information.
+
+* bug fixes
+
+ * support expectations on DelegateClass (Clifford T. Matthews). Closes #48.
+
=== Version 1.2.2 / 2009-03-22
Bug-fix release (fixes regression introduced in 1.2.1)
@@ -14,7 +33,7 @@ rspec-1.2.0.
See Upgrade.rdoc for information about upgrading to rspec-1.2.1
-* enhancments
+* enhancements
* matchers, including the new DSL, easily added to your test/unit tests
* added support for 0 to n args in matcher DSL
View
@@ -60,9 +60,11 @@ features/before_and_after_blocks/before_and_after_blocks.feature
features/example_groups/example_group_with_should_methods.feature
features/example_groups/implicit_docstrings.feature
features/example_groups/nested_groups.feature
-features/example_groups/output.feature
+features/extensions/custom_example_group.feature
+features/formatters/custom_formatter.feature
features/heckle/heckle.feature
features/interop/examples_and_tests_together.feature
+features/interop/rspec_output.feature
features/interop/test_but_not_test_unit.feature
features/interop/test_case_with_should_methods.feature
features/matchers/create_matcher.feature
@@ -72,7 +74,8 @@ features/mock_framework_integration/use_mocha.feature
features/mock_framework_integration/use_rr.feature
features/mocks/mix_stubs_and_mocks.feature
features/pending/pending_examples.feature
-features/step_definitions/running_rspec.rb
+features/runner/specify_line_number.feature
+features/step_definitions/running_rspec_steps.rb
features/subject/explicit_subject.feature
features/subject/implicit_subject.feature
features/support/env.rb
@@ -109,7 +112,7 @@ lib/spec/expectations/differs/default.rb
lib/spec/expectations/differs/load-diff-lcs.rb
lib/spec/expectations/errors.rb
lib/spec/expectations/extensions.rb
-lib/spec/expectations/extensions/object.rb
+lib/spec/expectations/extensions/kernel.rb
lib/spec/expectations/handler.rb
lib/spec/interop/test.rb
lib/spec/interop/test/unit/autorunner.rb
@@ -180,6 +183,7 @@ lib/spec/runner/formatter/html_formatter.rb
lib/spec/runner/formatter/nested_text_formatter.rb
lib/spec/runner/formatter/profile_formatter.rb
lib/spec/runner/formatter/progress_bar_formatter.rb
+lib/spec/runner/formatter/silent_formatter.rb
lib/spec/runner/formatter/snippet_extractor.rb
lib/spec/runner/formatter/specdoc_formatter.rb
lib/spec/runner/formatter/text_mate_formatter.rb
@@ -197,10 +201,6 @@ resources/rake/examples_with_rcov.rake
resources/rake/failing_examples_with_html.rake
resources/rake/verify_rcov.rake
resources/spec/example_group_with_should_methods.rb
-resources/spec/simple_spec.rb
-resources/test/spec_and_test_together.rb
-resources/test/spec_including_test_but_not_unit.rb
-resources/test/test_case_with_should_methods.rb
spec/README.jruby
spec/autotest/autotest_helper.rb
spec/autotest/autotest_matchers.rb
View
@@ -16,7 +16,7 @@ Hoe.new('rspec', Spec::VERSION::STRING) do |p|
p.description = "Behaviour Driven Development for Ruby."
p.rubyforge_name = 'rspec'
p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
- p.extra_dev_deps = [["cucumber",">= 0.1.13"]]
+ p.extra_dev_deps = [["cucumber",">= 0.2.2"]]
p.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
p.rspec_options = ['--options', 'spec/spec.opts']
p.history_file = 'History.rdoc'
View
@@ -1,4 +1,16 @@
-= Upgrade to rspec-1.2.1
+= Upgrade to master in git
+
+= What's Changed
+
+== Custom Formatters
+
+If you have an custom formatter, the <tt>add_example_group</tt> method has
+been changed to <tt>example_group_started</tt>, and kept as an alias so your
+formatters will still work. Though not yet, <tt>add_example_group</tt> will be
+deprecated in a future minor release, and removed in a future major release,
+so we recommend you make this change now.
+
+= Upgrade to rspec-1.2.2
== What's Changed
@@ -99,7 +111,7 @@ We'll still support the simple_matcher method, so never fear if you're using
that, but we recommend that you start developing your new matchers with this
new syntax.
- Spec::Matchers.create do :be_a_multiple_of |smaller|
+ Spec::Matchers.create :be_a_multiple_of do |smaller|
match do |bigger|
bigger % smaller == 0
end
@@ -3,10 +3,10 @@ Feature: before and after blocks
As a developer using RSpec
I want to execute arbitrary code before and after each example
So that I can control the environment in which it is run
-
+
This is supported by the before and after methods which each take a symbol
indicating the scope, and a block of code to execute.
-
+
before(:each) blocks are run before each example
before(:all) blocks are run once before all of the examples in a group
before(:suite) blocks are run once before the entire suite
@@ -22,14 +22,14 @@ Feature: before and after blocks
after each
after all
after suite
-
+
Before and after blocks can be defined in the example groups to which they
apply or in a configuration. When defined in a configuration, they can be
applied to all groups or subsets of all groups defined by example group
types.
-
+
Scenario: define before(:each) block in example group
- Given the following spec:
+ Given a file named "before_each_in_example_group_spec.rb" with:
"""
class Thing
def widgets
@@ -41,27 +41,27 @@ Feature: before and after blocks
before(:each) do
@thing = Thing.new
end
-
+
context "initialized in before(:each)" do
it "has 0 widgets" do
@thing.should have(0).widgets
end
-
+
it "can get accept new widgets" do
@thing.widgets << Object.new
end
-
+
it "does not share state across examples" do
@thing.should have(0).widgets
end
end
end
"""
- When I run it with the spec command
+ When I run "spec before_each_in_example_group_spec.rb"
Then the stdout should match "3 examples, 0 failures"
-
+
Scenario: define before(:all) block in example group
- Given the following spec:
+ Given a file named "before_all_in_example_group_spec.rb" with:
"""
class Thing
def widgets
@@ -73,27 +73,27 @@ Feature: before and after blocks
before(:all) do
@thing = Thing.new
end
-
+
context "initialized in before(:all)" do
it "has 0 widgets" do
@thing.should have(0).widgets
end
-
+
it "can get accept new widgets" do
@thing.widgets << Object.new
end
-
+
it "shares state across examples" do
@thing.should have(1).widgets
end
end
end
"""
- When I run it with the spec command
+ When I run "spec before_all_in_example_group_spec.rb"
Then the stdout should match "3 examples, 0 failures"
-
+
Scenario: define before and after blocks in configuration
- Given the following spec:
+ Given a file named "befores_in_configuration_spec.rb" with:
"""
Spec::Runner.configure do |config|
config.before(:suite) do
@@ -125,11 +125,11 @@ Feature: before and after blocks
end
end
"""
- When I run it with the spec command
+ When I run "spec befores_in_configuration_spec.rb"
Then the stdout should match "3 examples, 0 failures"
Scenario: before/after blocks are run in order
- Given the following spec:
+ Given a file named "ensure_block_order_spec.rb" with:
"""
Spec::Runner.configure do |config|
config.before(:suite) do
@@ -162,7 +162,6 @@ Feature: before and after blocks
end
end
"""
-
- When I run it with the spec command
+ When I run "spec ensure_block_order_spec.rb"
Then the stdout should match /before suite\nbefore all\nbefore each\nafter each\n\.after all\n.*after suite/m
@@ -1,20 +0,0 @@
-Feature: Getting correct output
-
- As an RSpec user
- I want to see output only once
- So that I don't get confused
-
- Scenario: Run with ruby
- Given the file ../../resources/spec/simple_spec.rb
- When I run it with the ruby interpreter
- Then the exit code should be 0
- And the stdout should not match /\d+ tests, \d+ assertions, \d+ failures, \d+ errors/m
- And the stdout should match "1 example, 0 failures"
-
- Scenario: Run with CommandLine object
- Given the file ../../resources/spec/simple_spec.rb
- When I run it with the CommandLine object
- Then the exit code should be 0
- And the stdout should not match "Loaded suite"
- And the stdout should not match /\d+ tests, \d+ assertions, \d+ failures, \d+ errors/m
- And the stdout should match "1 example, 0 failures"
@@ -0,0 +1,19 @@
+Feature: custom example group
+
+ Scenario: simple custom example group
+ Given a file named "custom_example_group_spec.rb" with:
+ """
+ class CustomGroup < Spec::ExampleGroup
+ end
+
+ Spec::Example::ExampleGroupFactory.default(CustomGroup)
+
+ describe "setting a default example group base class" do
+ it "should use that class by default" do
+ CustomGroup.should === self
+ end
+ end
+ """
+ When I run "spec custom_example_group_spec.rb"
+ Then the stdout should match "1 example, 0 failures"
+
@@ -0,0 +1,30 @@
+Feature: custom formatters
+
+ In order to format output/reporting to my particular needs
+ As an RSpec user
+ I want to create my own custom output formatters
+
+ Scenario: specdoc format
+ Given a file named "custom_formatter.rb" with:
+ """
+ require 'spec/runner/formatter/base_formatter'
+ class CustomFormatter < Spec::Runner::Formatter::BaseFormatter
+ def initialize(options, output)
+ @output = output
+ end
+ def example_started(proxy)
+ @output << "example: " << proxy.description
+ end
+ end
+ """
+ And a file named "simple_example_spec.rb" with:
+ """
+ describe "my group" do
+ specify "my example" do
+ end
+ end
+ """
+
+ When I run "spec simple_example_spec.rb --require custom_formatter.rb --format CustomFormatter"
+ Then the exit code should be 0
+ And the stdout should match "example: my example"
@@ -5,7 +5,7 @@ Feature: heckle a class
I want to heckle a class
Scenario: Heckle finds problems
- Given the following spec:
+ Given a file named "heckle_fail_spec.rb" with:
"""
class Thing
def a_or_b
@@ -16,19 +16,19 @@ Feature: heckle a class
end
end
end
-
+
describe Thing do
it "returns a for true" do
Thing.new.a_or_b.should == "a"
end
end
"""
- When I run it with the spec command --heckle Thing
+ When I run "spec heckle_fail_spec.rb --heckle Thing"
Then the stdout should match "The following mutations didn't cause test failures:"
But the stdout should not match "FAILED"
-
+
Scenario: Heckle does not find a problem
- Given the following spec:
+ Given a file named "heckle_success_spec.rb" with:
"""
class Thing
def a_or_b(key)
@@ -50,7 +50,7 @@ Feature: heckle a class
end
end
"""
- When I run it with the spec command --heckle Thing
+ When I run "spec heckle_success_spec.rb --heckle Thing"
Then the stdout should match "No mutants survived"
But the stdout should not match "FAILED"
-
+
Oops, something went wrong.

0 comments on commit 326ab10

Please sign in to comment.