Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: rspec/rspec-core
base: v2.1.0
...
head fork: rspec/rspec-core
compare: v2.0.0.beta.9
  • 13 commits
  • 82 files changed
  • 4 commit comments
  • 3 contributors
Showing with 417 additions and 364 deletions.
  1. +5 −9 README.markdown
  2. +9 −9 Rakefile
  3. +6 −6 Upgrade.markdown
  4. +1 −1  VERSION
  5. +1 −1  example_specs/spec_helper.rb
  6. +11 −11 features/command_line/line_number_appended_to_path.feature
  7. +3 −3 features/command_line/line_number_option.feature
  8. +15 −15 features/configuration/custom_options.feature
  9. +13 −13 features/configuration/options_file.feature
  10. +1 −1  features/example_groups/describe_aliases.feature
  11. +1 −1  features/example_groups/nested_groups.feature
  12. +6 −6 features/filtering/inclusion_filters.feature
  13. +1 −1  features/formatters/custom_formatter.feature
  14. +1 −1  features/hooks/around_hook.feature
  15. +11 −11 features/hooks/before_and_after_hooks.feature
  16. +1 −1  features/hooks/described_class.feature
  17. +2 −2 features/hooks/halt.feature
  18. +2 −2 features/mock_framework_integration/use_flexmock.feature
  19. +2 −2 features/mock_framework_integration/use_mocha.feature
  20. +2 −2 features/mock_framework_integration/use_rr.feature
  21. +2 −2 features/mock_framework_integration/use_rspec.feature
  22. +5 −5 features/pending/pending_examples.feature
  23. +4 −4 features/subject/explicit_subject.feature
  24. +2 −2 features/subject/implicit_subject.feature
  25. +1 −1  features/support/env.rb
  26. +1 −1  lib/autotest/rspec2.rb
  27. +1 −1  lib/rspec/autorun.rb
  28. +9 −9 lib/rspec/core.rb
  29. +1 −1  lib/rspec/core/around_proxy.rb
  30. +18 −13 lib/rspec/core/backward_compatibility.rb
  31. +8 −17 lib/rspec/core/configuration.rb
  32. +2 −2 lib/rspec/core/configuration_options.rb
  33. +3 −3 lib/rspec/core/deprecation.rb
  34. +1 −1  lib/rspec/core/errors.rb
  35. +3 −3 lib/rspec/core/example.rb
  36. +8 −8 lib/rspec/core/example_group.rb
  37. +1 −1  lib/rspec/core/formatters.rb
  38. +4 −4 lib/rspec/core/formatters/base_formatter.rb
  39. +3 −3 lib/rspec/core/formatters/base_text_formatter.rb
  40. +6 −9 lib/rspec/core/formatters/documentation_formatter.rb
  41. +5 −4 lib/rspec/core/formatters/helpers.rb
  42. +1 −1  lib/rspec/core/formatters/progress_formatter.rb
  43. +1 −1  lib/rspec/core/hooks.rb
  44. +1 −1  lib/rspec/core/let.rb
  45. +1 −1  lib/rspec/core/load_path.rb
  46. +4 −4 lib/rspec/core/metadata.rb
  47. +1 −1  lib/rspec/core/mocking/with_absolutely_nothing.rb
  48. +1 −1  lib/rspec/core/mocking/with_flexmock.rb
  49. +1 −1  lib/rspec/core/mocking/with_mocha.rb
  50. +2 −2 lib/rspec/core/mocking/with_rr.rb
  51. +3 −3 lib/rspec/core/mocking/with_rspec.rb
  52. +3 −3 lib/rspec/core/object_extensions.rb
  53. +2 −2 lib/rspec/core/pending.rb
  54. +2 −2 lib/rspec/core/rake_task.rb
  55. +1 −1  lib/rspec/core/ruby_project.rb
  56. +7 −7 lib/rspec/core/runner.rb
  57. +5 −5 lib/rspec/core/shared_example_group.rb
  58. +1 −1  lib/rspec/core/subject.rb
  59. +1 −1  lib/rspec/core/version.rb
  60. +7 −7 lib/rspec/core/world.rb
  61. +19 −11 rspec-core.gemspec
  62. +7 −7 spec/rspec/core/configuration_options_spec.rb
  63. +12 −15 spec/rspec/core/configuration_spec.rb
  64. +1 −1  spec/rspec/core/deprecations_spec.rb
  65. +10 −10 spec/rspec/core/example_group_spec.rb
  66. +6 −6 spec/rspec/core/example_spec.rb
  67. +2 −2 spec/rspec/core/formatters/base_formatter_spec.rb
  68. +21 −0 spec/rspec/core/formatters/base_text_formatter_spec.rb
  69. +30 −0 spec/rspec/core/formatters/documentation_formatter_spec.rb
  70. +18 −11 spec/rspec/core/formatters/helpers_spec.rb
  71. +2 −2 spec/rspec/core/formatters/progress_formatter_spec.rb
  72. +2 −2 spec/rspec/core/metadata_spec.rb
  73. +7 −7 spec/rspec/core/pending_example_spec.rb
  74. +1 −1  spec/rspec/core/ruby_project_spec.rb
  75. +9 −9 spec/rspec/core/runner_spec.rb
  76. +3 −3 spec/rspec/core/shared_example_group_spec.rb
  77. +1 −1  spec/rspec/core/subject_spec.rb
  78. +9 −9 spec/rspec/core/world_spec.rb
  79. +9 −9 spec/rspec/core_spec.rb
  80. +9 −9 spec/spec_helper.rb
  81. +2 −2 spec/support/matchers.rb
  82. +10 −10 specs.watchr
14 README.markdown
View
@@ -1,10 +1,6 @@
-# Rspec Core
+# RSpec Core
-Rspec is an automated testing framework for Ruby, designed for use in Behaviour
-Driven Development and Test Driven Development.
-
-rspec-core includes the Rspec runner, output formatters, and the `rspec`
-command.
+Behaviour Driven Development for Ruby
## Upgrading from rspec-1.x
@@ -12,7 +8,7 @@ See Upgrade.markdown
## Install
- [sudo] gem install rspec --prerelease
+ gem install rspec --prerelease
This will install the rspec, rspec-core, rspec-expectations and rspec-mocks
gems.
@@ -20,7 +16,7 @@ gems.
## Get Started
Start with a simple example of behavior you expect from your system. Do
-this before you write any code:
+this before you write any implementation code:
# in spec/calculator_spec.rb
describe Calculator, "add" do
@@ -46,7 +42,7 @@ Implement the simplest solution:
Be sure to require the implementation file in the spec:
# in spec/calculator_spec.rb
- # - Rspec adds ./lib to the $LOAD_PATH, so you can
+ # - RSpec adds ./lib to the $LOAD_PATH, so you can
# just require "calculator" directly
require "calculator"
18 Rakefile
View
@@ -13,15 +13,15 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rspec-core"
- gem.version = Rspec::Core::Version::STRING
- gem.summary = "rspec-core-#{Rspec::Core::Version::STRING}"
- gem.description = 'Rspec runner and example group classes'
+ gem.version = RSpec::Core::Version::STRING
+ gem.summary = "rspec-core-#{RSpec::Core::Version::STRING}"
+ gem.description = 'RSpec runner and example group classes'
gem.email = "dchelimsky@gmail.com;chad.humphries@gmail.com"
gem.homepage = "http://github.com/rspec/core"
gem.authors = ["Chad Humphries", "David Chelimsky"]
gem.rubyforge_project = "rspec"
- gem.add_development_dependency "rspec-expectations", ">= #{Rspec::Core::Version::STRING}"
- gem.add_development_dependency "rspec-mocks", ">= #{Rspec::Core::Version::STRING}"
+ gem.add_development_dependency "rspec-expectations", ">= #{RSpec::Core::Version::STRING}"
+ gem.add_development_dependency "rspec-mocks", ">= #{RSpec::Core::Version::STRING}"
gem.add_development_dependency('cucumber', '>= 0.5.3')
gem.add_development_dependency('autotest', '>= 4.2.9')
gem.post_install_message = <<-EOM
@@ -43,14 +43,14 @@ end
namespace :gem do
desc "push to gemcutter"
task :push => :build do
- system "gem push pkg/rspec-core-#{Rspec::Core::Version::STRING}.gem"
+ system "gem push pkg/rspec-core-#{RSpec::Core::Version::STRING}.gem"
end
end
-Rspec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec)
desc "Run all examples using rcov"
-Rspec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
+RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
t.rcov = true
t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
t.rcov_opts << %[--no-html --aggregate coverage.data]
@@ -85,7 +85,7 @@ end
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "rspec-core #{Rspec::Core::Version::STRING}"
+ rdoc.title = "rspec-core #{RSpec::Core::Version::STRING}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
12 Upgrade.markdown
View
@@ -2,16 +2,16 @@
## What's changed
-### Rspec namespace
+### RSpec namespace
-The root namespace is now `Rspec` instead of `Spec`, and the root directory
+The root namespace is now `RSpec` instead of `Spec`, and the root directory
under `lib` is `rspec` instead of `spec`.
### Configuration
Typically in `spec/spec_helper.rb`, configuration is now done like this:
- Rspec.configure do |c|
+ RSpec.configure do |c|
# ....
end
@@ -38,7 +38,7 @@ each example in a variety of ways.
The most obvious use is for filtering the run. For example:
# in spec/spec_helper.rb
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.filter_run :focus => true
end
@@ -54,7 +54,7 @@ When you run the `rspec` command, rspec will run only the examples that have
You can also add `run_all_when_everything_filtered` to the config:
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.filter_run :focus => true
c.run_all_when_everything_filtered = true
end
@@ -72,7 +72,7 @@ rspec-core, and here's how we're getting the right stuff to run under the
right version:
# in spec/spec_helper.rb
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.exclusion_filter = { :ruby => lambda {|version|
!(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
}}
2  VERSION
View
@@ -1 +1 @@
-2.0.0.beta.8
+2.0.0.beta.9
2  example_specs/spec_helper.rb
View
@@ -4,7 +4,7 @@
require 'rspec/expectations'
require 'rspec/core'
-Rspec.configure do |c|
+RSpec.configure do |c|
c.mock_with :rspec
end
22 features/command_line/line_number_appended_to_path.feature
View
@@ -29,77 +29,77 @@ Feature: line number appended to file path
"""
Scenario: nested groups - outer group on declaration line
- When I run "rspec example_spec.rb:1 --format doc"
+ When I run "rspec ./example_spec.rb:1 --format doc"
Then I should see "3 examples, 0 failures"
And I should see "second example in outer group"
And I should see "first example in outer group"
And I should see "example in nested group"
Scenario: nested groups - outer group inside block before example
- When I run "rspec example_spec.rb:2 --format doc"
+ When I run "rspec ./example_spec.rb:2 --format doc"
Then I should see "3 examples, 0 failures"
And I should see "second example in outer group"
And I should see "first example in outer group"
And I should see "example in nested group"
Scenario: nested groups - inner group on declaration line
- When I run "rspec example_spec.rb:11 --format doc"
+ When I run "rspec ./example_spec.rb:11 --format doc"
Then I should see "1 example, 0 failures"
And I should see "example in nested group"
And I should not see "second example in outer group"
And I should not see "first example in outer group"
Scenario: nested groups - inner group inside block before example
- When I run "rspec example_spec.rb:12 --format doc"
+ When I run "rspec ./example_spec.rb:12 --format doc"
Then I should see "1 example, 0 failures"
And I should see "example in nested group"
And I should not see "second example in outer group"
And I should not see "first example in outer group"
Scenario: two examples - first example on declaration line
- When I run "rspec example_spec.rb:3 --format doc"
+ When I run "rspec ./example_spec.rb:3 --format doc"
Then I should see "1 example, 0 failures"
And I should see "first example in outer group"
But I should not see "second example in outer group"
And I should not see "example in nested group"
Scenario: two examples - first example inside block
- When I run "rspec example_spec.rb:4 --format doc"
+ When I run "rspec ./example_spec.rb:4 --format doc"
Then I should see "1 example, 0 failures"
And I should see "first example in outer group"
But I should not see "second example in outer group"
And I should not see "example in nested group"
Scenario: two examples - first example on end
- When I run "rspec example_spec.rb:5 --format doc"
+ When I run "rspec ./example_spec.rb:5 --format doc"
Then I should see "1 example, 0 failures"
And I should see "first example in outer group"
But I should not see "second example in outer group"
And I should not see "example in nested group"
Scenario: two examples - first example after end but before next example
- When I run "rspec example_spec.rb:6 --format doc"
+ When I run "rspec ./example_spec.rb:6 --format doc"
Then I should see "1 example, 0 failures"
And I should see "first example in outer group"
But I should not see "second example in outer group"
And I should not see "example in nested group"
Scenario: two examples - second example on declaration line
- When I run "rspec example_spec.rb:7 --format doc"
+ When I run "rspec ./example_spec.rb:7 --format doc"
Then I should see "1 example, 0 failures"
And I should see "second example in outer group"
But I should not see "first example in outer group"
And I should not see "example in nested group"
Scenario: two examples - second example inside block
- When I run "rspec example_spec.rb:7 --format doc"
+ When I run "rspec ./example_spec.rb:7 --format doc"
Then I should see "1 example, 0 failures"
And I should see "second example in outer group"
But I should not see "first example in outer group"
And I should not see "example in nested group"
Scenario: two examples - second example on end
- When I run "rspec example_spec.rb:7 --format doc"
+ When I run "rspec ./example_spec.rb:7 --format doc"
Then I should see "1 example, 0 failures"
And I should see "second example in outer group"
But I should not see "first example in outer group"
6 features/command_line/line_number_option.feature
View
@@ -1,6 +1,6 @@
Feature: line number option
- As an Rspec user
+ As an RSpec user
I want to run one example identified by the line number
Scenario: standard examples
@@ -20,7 +20,7 @@ Feature: line number option
end
"""
- When I run "rspec example_spec.rb --line 5 --format doc"
+ When I run "rspec ./example_spec.rb --line 5 --format doc"
Then I should see "1 example, 0 failures"
Then I should see "should be > 8"
But the stdout should not contain "should be < 10"
@@ -38,7 +38,7 @@ Feature: line number option
end
"""
- When I run "rspec example_spec.rb --line 5 --format doc"
+ When I run "rspec ./example_spec.rb --line 5 --format doc"
Then I should see "1 example, 0 failures"
Then I should see "should be > 8"
But the stdout should not contain "should be < 10"
30 features/configuration/custom_options.feature
View
@@ -1,71 +1,71 @@
Feature: custom options
In order to seamlessly provide my users more options
- As an Rspec extenstion-library author
- I want to define new options on the Rspec.configuration
+ As an RSpec extenstion-library author
+ I want to define new options on the RSpec.configuration
Scenario: boolean option with default settings
Given a file named "boolean_option_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.add_option :custom_option, :type => :boolean
end
describe "custom option" do
it "is false by default" do
- Rspec.configuration.custom_option.should be_false
+ RSpec.configuration.custom_option.should be_false
end
it "is exposed as a predicate" do
- Rspec.configuration.custom_option?.should be_false
+ RSpec.configuration.custom_option?.should be_false
end
end
"""
- When I run "rspec boolean_option_spec.rb"
+ When I run "rspec ./boolean_option_spec.rb"
Then I should see "2 examples, 0 failures"
Scenario: boolean option set to default to true
Given a file named "boolean_option_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.add_option :custom_option, :type => :boolean, :default => true
end
describe "custom option" do
it "is true by default" do
- Rspec.configuration.custom_option.should be_true
+ RSpec.configuration.custom_option.should be_true
end
it "is exposed as a predicate" do
- Rspec.configuration.custom_option?.should be_true
+ RSpec.configuration.custom_option?.should be_true
end
end
"""
- When I run "rspec boolean_option_spec.rb"
+ When I run "rspec ./boolean_option_spec.rb"
Then I should see "2 examples, 0 failures"
@wip
Scenario: boolean option overridden in client app
Given a file named "boolean_option_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.add_option :custom_option, :type => :boolean
end
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.custom_option = true
end
describe "custom option" do
it "returns the value set in the client app" do
- Rspec.configuration.custom_option.should be_true
+ RSpec.configuration.custom_option.should be_true
end
it "is exposed as a predicate" do
- Rspec.configuration.custom_option?.should be_true
+ RSpec.configuration.custom_option?.should be_true
end
end
"""
- When I run "rspec boolean_option_spec.rb"
+ When I run "rspec ./boolean_option_spec.rb"
Then I should see "2 examples, 0 failures"
26 features/configuration/options_file.feature
View
@@ -5,22 +5,22 @@ Feature: spec/spec.opts
automatically.
Options declared in spec/spec.opts will override configuration
- set up in Rspec.configure blocks.
+ set up in RSpec.configure blocks.
- Scenario: color set in Rspec.configure
+ Scenario: color set in RSpec.configure
Given a file named "spec/example_spec.rb" with:
"""
- Rspec.configure {|c| c.color_enabled = true }
+ RSpec.configure {|c| c.color_enabled = true }
describe "color_enabled" do
- context "when set with Rspec.configure" do
+ context "when set with RSpec.configure" do
it "is true" do
- Rspec.configuration.color_enabled?.should be_true
+ RSpec.configuration.color_enabled?.should be_true
end
end
end
"""
- When I run "rspec spec/example_spec.rb"
+ When I run "rspec ./spec/example_spec.rb"
Then I should see "1 example, 0 failures"
Scenario: color set in .rspec
@@ -31,14 +31,14 @@ Feature: spec/spec.opts
And a file named "spec/example_spec.rb" with:
"""
describe "color_enabled" do
- context "when set with Rspec.configure" do
+ context "when set with RSpec.configure" do
it "is true" do
- Rspec.configuration.color_enabled?.should be_true
+ RSpec.configuration.color_enabled?.should be_true
end
end
end
"""
- When I run "rspec spec/example_spec.rb"
+ When I run "rspec ./spec/example_spec.rb"
Then I should see "1 example, 0 failures"
@wip
@@ -49,20 +49,20 @@ Feature: spec/spec.opts
"""
And a file named "spec/spec_helper.rb" with:
"""
- Rspec.configure {|c| c.formatter = 'progress'}
+ RSpec.configure {|c| c.formatter = 'progress'}
"""
And a file named "spec/example_spec.rb" with:
"""
require "spec_helper"
describe "formatter" do
- context "when set with Rspec.configure and in spec.opts" do
+ context "when set with RSpec.configure and in spec.opts" do
it "takes the value set in spec.opts" do
- Rspec.configuration.formatter.should be_an(Rspec::Core::Formatters::DocumentationFormatter)
+ RSpec.configuration.formatter.should be_an(RSpec::Core::Formatters::DocumentationFormatter)
end
end
end
"""
- When I run "rspec spec/example_spec.rb"
+ When I run "rspec ./spec/example_spec.rb"
Then I should see "1 example, 0 failures"
2  features/example_groups/describe_aliases.feature
View
@@ -17,7 +17,7 @@ Feature: Nested example groups
end
end
"""
- When I run "rspec context_instead_of_describe_spec.rb -fn"
+ When I run "rspec ./context_instead_of_describe_spec.rb -fn"
Then I should see:
"""
Using context
2  features/example_groups/nested_groups.feature
View
@@ -20,7 +20,7 @@ Feature: Nested example groups
end
end
"""
- When I run "rspec nested_example_groups.rb -fdoc"
+ When I run "rspec ./nested_example_groups.rb -fdoc"
Then I should see matching /^Some Object/
And I should see matching /^\s+with some more context/
And I should see matching /^\s+with some other context/
12 features/filtering/inclusion_filters.feature
View
@@ -3,7 +3,7 @@ Feature: inclusion feature
Scenario: focus on one example
Given a file named "spec/sample_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.filter_run :focus => true
end
@@ -15,14 +15,14 @@ Feature: inclusion feature
end
end
"""
- When I run "rspec spec/sample_spec.rb --format doc"
+ When I run "rspec ./spec/sample_spec.rb --format doc"
Then I should see "does another thing"
And I should not see "does one thing"
Scenario: focus on one group
Given a file named "spec/sample_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.filter_run :focus => true
end
@@ -39,7 +39,7 @@ Feature: inclusion feature
end
end
"""
- When I run "rspec spec/sample_spec.rb --format doc"
+ When I run "rspec ./spec/sample_spec.rb --format doc"
Then I should see "group 1 example 1"
And I should see "group 1 example 2"
And I should not see "group 2 example 1"
@@ -47,7 +47,7 @@ Feature: inclusion feature
Scenario: no examples match filter
Given a file named "spec/sample_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.filter_run :focus => true
c.run_all_when_everything_filtered = true
end
@@ -65,7 +65,7 @@ Feature: inclusion feature
end
end
"""
- When I run "rspec spec/sample_spec.rb --format doc"
+ When I run "rspec ./spec/sample_spec.rb --format doc"
Then I should see "No examples were matched by {:focus=>true}, running all"
And I should see "group 1 example 1"
And I should see "group 1 example 2"
2  features/formatters/custom_formatter.feature
View
@@ -27,6 +27,6 @@ Feature: custom formatters
end
"""
- When I run "rspec simple_example_spec.rb --require custom_formatter.rb --format CustomFormatter"
+ When I run "rspec ./simple_example_spec.rb --require custom_formatter.rb --format CustomFormatter"
Then I should see "example: my example"
And the exit status should be 0
2  features/hooks/around_hook.feature
View
@@ -31,6 +31,6 @@ Feature: around hook
end
end
"""
- When I run "rspec around_each_in_example_group_spec.rb"
+ When I run "rspec ./around_each_in_example_group_spec.rb"
Then the stderr should not contain "NoMethodError"
Then I should see "2 examples, 0 failures"
22 features/hooks/before_and_after_hooks.feature
View
@@ -55,7 +55,7 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec before_each_spec.rb"
+ When I run "rspec ./before_each_spec.rb"
Then I should see "3 examples, 0 failures"
Scenario: define before(:all) block in example group
@@ -89,10 +89,10 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec before_all_spec.rb"
+ When I run "rspec ./before_all_spec.rb"
Then I should see "3 examples, 0 failures"
- When I run "rspec before_all_spec.rb:15"
+ When I run "rspec ./before_all_spec.rb:15"
Then I should see "1 example, 0 failures"
Scenario: define before and after blocks in configuration
@@ -100,7 +100,7 @@ Feature: before and after hooks
"""
require "rspec/expectations"
- Rspec.configure do |config|
+ RSpec.configure do |config|
config.before(:each) do
@before_each = "before each"
end
@@ -122,7 +122,7 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec befores_in_configuration_spec.rb"
+ When I run "rspec ./befores_in_configuration_spec.rb"
Then I should see "2 examples, 0 failures"
Scenario: before/after blocks are run in order
@@ -152,7 +152,7 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec ensure_block_order_spec.rb"
+ When I run "rspec ./ensure_block_order_spec.rb"
Then I should see matching /before all\nbefore each\nafter each\n.after all/
Scenario: before/after all blocks are run once
@@ -185,15 +185,15 @@ Feature: before and after hooks
end
"""
- When I run "rspec before_and_after_all_spec.rb"
+ When I run "rspec ./before_and_after_all_spec.rb"
Then I should see "2 examples, 0 failures"
Then I should see matching /outer before all\n.inner before all\n.inner after all\nouter after all\n\n\n\nFinished/
- When I run "rspec before_and_after_all_spec.rb:14"
+ When I run "rspec ./before_and_after_all_spec.rb:14"
Then I should see "1 example, 0 failures"
Then I should see matching /outer before all\ninner before all\n.inner after all\nouter after all\n\n\n\nFinished/
- When I run "rspec before_and_after_all_spec.rb:6"
+ When I run "rspec ./before_and_after_all_spec.rb:6"
Then I should see "1 example, 0 failures"
Then I should see matching /outer before all\n.outer after all\n\n\n\nFinished/
@@ -209,7 +209,7 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec error_in_before_each_spec.rb"
+ When I run "rspec ./error_in_before_each_spec.rb"
Then I should see "1 example, 1 failure"
And I should see "this error"
@@ -226,6 +226,6 @@ Feature: before and after hooks
end
end
"""
- When I run "rspec error_in_before_all_spec.rb"
+ When I run "rspec ./error_in_before_all_spec.rb"
Then I should see "1 example, 1 failure"
And I should see "this error"
2  features/hooks/described_class.feature
View
@@ -9,6 +9,6 @@ Feature: described class
end
end
"""
- When I run "rspec spec/example_spec.rb"
+ When I run "rspec ./spec/example_spec.rb"
Then I should see "1 example, 0 failures"
4 features/hooks/halt.feature
View
@@ -9,7 +9,7 @@ Feature: halt
Given a directory named "spec"
And a file named "spec/example_spec.rb" with:
"""
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.after(:each) do
running_example.halt(:group, :status => 'failed')
end
@@ -23,5 +23,5 @@ Feature: halt
end
end
"""
- When I run "rspec spec/example_spec.rb"
+ When I run "rspec ./spec/example_spec.rb"
Then I should see "1 example, 1 failure"
4 features/mock_framework_integration/use_flexmock.feature
View
@@ -6,7 +6,7 @@ Feature: mock with flexmock
Scenario: Mock with flexmock
Given a file named "flexmock_example_spec.rb" with:
"""
- Rspec.configure do |config|
+ RSpec.configure do |config|
config.mock_framework = :flexmock
end
@@ -18,6 +18,6 @@ Feature: mock with flexmock
end
end
"""
- When I run "rspec flexmock_example_spec.rb"
+ When I run "rspec ./flexmock_example_spec.rb"
Then I should see "1 example, 0 failures"
And the exit status should be 0
4 features/mock_framework_integration/use_mocha.feature
View
@@ -6,7 +6,7 @@ Feature: mock with mocha
Scenario: Mock with mocha
Given a file named "mocha_example_spec.rb" with:
"""
- Rspec.configure do |config|
+ RSpec.configure do |config|
config.mock_framework = :mocha
end
@@ -18,6 +18,6 @@ Feature: mock with mocha
end
end
"""
- When I run "rspec mocha_example_spec.rb"
+ When I run "rspec ./mocha_example_spec.rb"
Then I should see "1 example, 0 failures"
And the exit status should be 0
4 features/mock_framework_integration/use_rr.feature
View
@@ -6,7 +6,7 @@ Feature: mock with rr
Scenario: Mock with rr
Given a file named "rr_example_spec.rb" with:
"""
- Rspec.configure do |config|
+ RSpec.configure do |config|
config.mock_framework = :rr
end
@@ -18,6 +18,6 @@ Feature: mock with rr
end
end
"""
- When I run "rspec rr_example_spec.rb"
+ When I run "rspec ./rr_example_spec.rb"
Then I should see "1 example, 0 failures"
And the exit status should be 0
4 features/mock_framework_integration/use_rspec.feature
View
@@ -6,7 +6,7 @@ Feature: mock with rspec
Scenario: Mock with rspec
Given a file named "rspec_example_spec.rb" with:
"""
- Rspec.configure do |config|
+ RSpec.configure do |config|
config.mock_framework = :rspec
end
@@ -18,6 +18,6 @@ Feature: mock with rspec
end
end
"""
- When I run "rspec rspec_example_spec.rb"
+ When I run "rspec ./rspec_example_spec.rb"
Then I should see "1 example, 0 failures"
And the exit status should be 0
10 features/pending/pending_examples.feature
View
@@ -1,6 +1,6 @@
Feature: pending examples
- Rspec offers three ways to indicate that an example is disabled pending
+ RSpec offers three ways to indicate that an example is disabled pending
some action.
Scenario: pending implementation
@@ -10,7 +10,7 @@ Feature: pending examples
it "is a pending example"
end
"""
- When I run "rspec example_without_block_spec.rb"
+ When I run "rspec ./example_without_block_spec.rb"
Then the exit status should be 0
And I should see "1 example, 0 failures, 1 pending"
And I should see "Not Yet Implemented"
@@ -26,7 +26,7 @@ Feature: pending examples
end
end
"""
- When I run "rspec pending_without_block_spec.rb"
+ When I run "rspec ./pending_without_block_spec.rb"
Then the exit status should be 0
And I should see "1 example, 0 failures, 1 pending"
And I should see "(something else getting finished)"
@@ -43,7 +43,7 @@ Feature: pending examples
end
end
"""
- When I run "rspec pending_with_failing_block_spec.rb"
+ When I run "rspec ./pending_with_failing_block_spec.rb"
Then the exit status should be 0
And I should see "1 example, 0 failures, 1 pending"
And I should see "(something else getting finished)"
@@ -60,7 +60,7 @@ Feature: pending examples
end
end
"""
- When I run "rspec pending_with_passing_block_spec.rb"
+ When I run "rspec ./pending_with_passing_block_spec.rb"
Then the exit status should not be 0
And I should see "1 example, 1 failure"
And I should see "FIXED"
8 features/subject/explicit_subject.feature
View
@@ -14,7 +14,7 @@ Feature: explicit subject
end
end
"""
- When I run "rspec top_level_subject_spec.rb"
+ When I run "rspec ./top_level_subject_spec.rb"
Then I should see "1 example, 0 failures"
Scenario: subject in a nested group
@@ -31,7 +31,7 @@ Feature: explicit subject
end
end
"""
- When I run "rspec nested_subject_spec.rb"
+ When I run "rspec ./nested_subject_spec.rb"
Then I should see "1 example, 0 failures"
Scenario: access subject from before block
@@ -45,7 +45,7 @@ Feature: explicit subject
end
end
"""
- When I run "rspec top_level_subject_spec.rb"
+ When I run "rspec ./top_level_subject_spec.rb"
Then I should see "1 example, 0 failures"
Scenario: subject using helper method
@@ -63,5 +63,5 @@ Feature: explicit subject
end
end
"""
- When I run "rspec helper_subject_spec.rb"
+ When I run "rspec ./helper_subject_spec.rb"
Then I should see "1 example, 0 failures"
4 features/subject/implicit_subject.feature
View
@@ -13,7 +13,7 @@ Feature: implicit subject
end
end
"""
- When I run "rspec top_level_subject_spec.rb"
+ When I run "rspec ./top_level_subject_spec.rb"
Then I should see "1 example, 0 failures"
Scenario: subject in a nested group
@@ -27,5 +27,5 @@ Feature: implicit subject
end
end
"""
- When I run "rspec nested_subject_spec.rb"
+ When I run "rspec ./nested_subject_spec.rb"
Then I should see "1 example, 0 failures"
2  features/support/env.rb
View
@@ -5,7 +5,7 @@
module ArubaOverrides
def detect_ruby_script(cmd)
if cmd =~ /^rspec /
- "ruby -I. -I../../lib -S ../../bin/#{cmd}"
+ "ruby -I../../lib -S ../../bin/#{cmd}"
else
super(cmd)
end
2  lib/autotest/rspec2.rb
View
@@ -14,7 +14,7 @@
}
end
-class RspecCommandError < StandardError; end
+class RSpecCommandError < StandardError; end
class Autotest::Rspec2 < Autotest
2  lib/rspec/autorun.rb
View
@@ -1,2 +1,2 @@
require 'rspec/core'
-Rspec::Core::Runner.autorun
+RSpec::Core::Runner.autorun
18 lib/rspec/core.rb
View
@@ -21,7 +21,7 @@
require 'rspec/core/version'
require 'rspec/core/errors'
-module Rspec
+module RSpec
module Core
def self.install_directory
@@ -29,28 +29,28 @@ def self.install_directory
end
def self.configuration
- Rspec.deprecate('Rspec::Core.configuration', 'Rspec.configuration', '2.0.0')
- Rspec.configuration
+ RSpec.deprecate('RSpec::Core.configuration', 'RSpec.configuration', '2.0.0')
+ RSpec.configuration
end
def self.configure
- Rspec.deprecate('Rspec::Core.configure', 'Rspec.configure', '2.0.0')
- yield Rspec.configuration if block_given?
+ RSpec.deprecate('RSpec::Core.configure', 'RSpec.configure', '2.0.0')
+ yield RSpec.configuration if block_given?
end
def self.world
- Rspec.deprecate('Rspec::Core.world', 'Rspec.world', '2.0.0')
- Rspec.world
+ RSpec.deprecate('RSpec::Core.world', 'RSpec.world', '2.0.0')
+ RSpec.world
end
end
def self.world
- @world ||= Rspec::Core::World.new
+ @world ||= RSpec::Core::World.new
end
def self.configuration
- @configuration ||= Rspec::Core::Configuration.new
+ @configuration ||= RSpec::Core::Configuration.new
end
def self.configure
2  lib/rspec/core/around_proxy.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
class AroundProxy
def initialize(example_group_instance, &example_block)
31 lib/rspec/core/backward_compatibility.rb
View
@@ -1,32 +1,37 @@
-module Rspec
+module RSpec
module Core
class Configuration
def mock_with(use_me_to_mock)
self.mock_framework = use_me_to_mock
end
end
- end
-end
-module ConstMissing
- def const_missing(name)
- if :Spec == name
- Rspec.warn <<-WARNING
+ module ConstMissing
+ def const_missing(name)
+ case name
+ when :Rspec
+ RSpec
+ when :Spec
+ RSpec.warn <<-WARNING
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
-be removed from a future version of Rspec.
+be removed from a future version of RSpec.
* Spec is deprecated.
-* Rspec is the new top-level module in Rspec-2
+* RSpec is the new top-level module in RSpec-2
#{caller(0)[1]}
*****************************************************************
WARNING
- Rspec
- else
- super(name)
+ RSpec
+ else
+ super(name)
+ end
+ end
end
+
end
+
end
-Object.extend(ConstMissing)
+Object.extend(RSpec::Core::ConstMissing)
25 lib/rspec/core/configuration.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
class Configuration
attr_reader :hooks # :nodoc:
@@ -29,11 +29,10 @@ def default_options
{
:color_enabled => false,
:mock_framework => nil,
- :use_transactional_examples => true,
:profile_examples => false,
:files_to_run => [],
:filename_pattern => '**/*_spec.rb',
- :formatter_class => Rspec::Core::Formatters::ProgressFormatter,
+ :formatter_class => RSpec::Core::Formatters::ProgressFormatter,
:backtrace_clean_patterns => [/\/lib\/ruby\//,
/bin\/rcov:/,
/vendor\/rails/,
@@ -59,14 +58,6 @@ def mock_framework=(use_me_to_mock)
@options[:mock_framework] = use_me_to_mock
end
- def use_transactional_examples=(value)
- @options[:use_transactional_examples] = value
- end
-
- def use_transactional_examples?
- @options[:use_transactional_examples]
- end
-
def require_mock_framework_adapter
require case @options[:mock_framework].to_s
when "", /rspec/i
@@ -148,9 +139,9 @@ def formatter_class
def formatter=(formatter_to_use)
formatter_class = case formatter_to_use.to_s
when 'd', 'doc', 'documentation', 's', 'n', 'spec', 'nested'
- Rspec::Core::Formatters::DocumentationFormatter
+ RSpec::Core::Formatters::DocumentationFormatter
when 'progress'
- Rspec::Core::Formatters::ProgressFormatter
+ RSpec::Core::Formatters::ProgressFormatter
else
raise ArgumentError, "Formatter '#{formatter_to_use}' unknown - maybe you meant 'documentation' or 'progress'?."
end
@@ -183,7 +174,7 @@ def files_or_directories_to_run=(*files)
# E.g. alias_example_to :crazy_slow, :speed => 'crazy_slow' defines
# crazy_slow as an example variant that has the crazy_slow speed option
def alias_example_to(new_name, extra_options={})
- Rspec::Core::ExampleGroup.alias_example_to(new_name, extra_options)
+ RSpec::Core::ExampleGroup.alias_example_to(new_name, extra_options)
end
def filter_run(options={})
@@ -232,18 +223,18 @@ def find_hook(hook, each_or_all, group)
def configure_mock_framework
require_mock_framework_adapter
- Rspec::Core::ExampleGroup.send(:include, Rspec::Core::MockFrameworkAdapter)
+ RSpec::Core::ExampleGroup.send(:include, RSpec::Core::MockFrameworkAdapter)
end
def require_files_to_run
- files_to_run.map {|f| require f }
+ files_to_run.map {|f| require File.expand_path(f) }
end
def add_option(mname, options)
case options[:type]
when :boolean
(class << self; self; end).class_eval do
- attr_reader mname
+ attr_accessor mname
define_method("#{mname}?") { !!(send mname) }
end
instance_variable_set "@#{mname}", options[:default]
4 lib/rspec/core/configuration_options.rb
View
@@ -1,7 +1,7 @@
require 'optparse'
# http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html
-module Rspec
+module RSpec
module Core
class ConfigurationOptions
@@ -128,7 +128,7 @@ def args_from_options_file(path)
def local_options_file
return @options.delete(:options_file) if @options[:options_file]
return LOCAL_OPTIONS_FILE if File.exist?(LOCAL_OPTIONS_FILE)
- Rspec.deprecate("spec/spec.opts", ".rspec or ~/.rspec", "2.0.0") if File.exist?("spec/spec.opts")
+ RSpec.deprecate("spec/spec.opts", ".rspec or ~/.rspec", "2.0.0") if File.exist?("spec/spec.opts")
"spec/spec.opts"
end
6 lib/rspec/core/deprecation.rb
View
@@ -1,8 +1,8 @@
-module Rspec
+module RSpec
class << self
def deprecate(method, alternate_method=nil, version=nil)
- version_string = version ? "rspec-#{version}" : "a future version of Rspec"
+ version_string = version ? "rspec-#{version}" : "a future version of RSpec"
message = <<-NOTICE
@@ -37,7 +37,7 @@ def initialize(method, alternate_method=nil, &block)
end
def []=(k,v)
- Rspec.deprecate(@method, @alternate_method)
+ RSpec.deprecate(@method, @alternate_method)
super
end
2  lib/rspec/core/errors.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
# If Test::Unit is loaed, we'll use its error as baseclass, so that Test::Unit
# will report unmet RSpec expectations as failures rather than errors.
6 lib/rspec/core/example.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
class Example
@@ -118,8 +118,8 @@ def run_after_each
def assign_auto_description
if description.empty?
- metadata[:description] = Rspec::Matchers.generated_description
- Rspec::Matchers.clear_generated_description
+ metadata[:description] = RSpec::Matchers.generated_description
+ RSpec::Matchers.clear_generated_description
end
end
16 lib/rspec/core/example_group.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
class ExampleGroup
extend Hooks
@@ -9,11 +9,11 @@ class ExampleGroup
attr_accessor :running_example
def self.world
- Rspec.world
+ RSpec.world
end
def self.inherited(klass)
- Rspec::Core::Runner.autorun
+ RSpec::Core::Runner.autorun
world.example_groups << klass if klass.superclass == ExampleGroup
end
@@ -36,7 +36,7 @@ def self.#{name}(desc=nil, options={}, &block)
options.update(:pending => true) unless block
options.update(:caller => caller)
options.update(#{extra_options.inspect})
- examples << Rspec::Core::Example.new(self, desc, options, block)
+ examples << RSpec::Core::Example.new(self, desc, options, block)
examples.last
end
END_RUBY
@@ -57,7 +57,7 @@ class << self
def self.it_should_behave_like(*names)
names.each do |name|
begin
- module_eval &Rspec.world.shared_example_groups[name]
+ module_eval &RSpec.world.shared_example_groups[name]
rescue ArgumentError
raise "Could not find shared example group named #{name.inspect}"
end
@@ -116,11 +116,11 @@ def self.descendents
end
def self.ancestors
- @_ancestors ||= super().select {|a| a < Rspec::Core::ExampleGroup}
+ @_ancestors ||= super().select {|a| a < RSpec::Core::ExampleGroup}
end
def self.set_it_up(*args)
- @metadata = Rspec::Core::Metadata.new(superclass_metadata).process(*args)
+ @metadata = RSpec::Core::Metadata.new(superclass_metadata).process(*args)
world.find_modules(self).each do |include_or_extend, mod, opts|
send(include_or_extend, mod) unless mixins[include_or_extend].include?(mod)
@@ -191,7 +191,7 @@ def self.run_examples(instance, reporter)
end
def self.to_s
- self == Rspec::Core::ExampleGroup ? 'Rspec::Core::ExampleGroup' : name
+ self == RSpec::Core::ExampleGroup ? 'RSpec::Core::ExampleGroup' : name
end
def self.all_apply?(filters)
2  lib/rspec/core/formatters.rb
View
@@ -4,7 +4,7 @@
require 'rspec/core/formatters/documentation_formatter'
require 'rspec/core/formatters/progress_formatter'
-module Rspec
+module RSpec
module Core
8 lib/rspec/core/formatters/base_formatter.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
module Formatters
@@ -18,11 +18,11 @@ def output
end
def pending_examples
- @pending_examples ||= ::Rspec.world.find(examples, :execution_result => { :status => 'pending' })
+ @pending_examples ||= ::RSpec.world.find(examples, :execution_result => { :status => 'pending' })
end
def failed_examples
- @failed_examples ||= ::Rspec.world.find(examples, :execution_result => { :status => 'failed' })
+ @failed_examples ||= ::RSpec.world.find(examples, :execution_result => { :status => 'failed' })
end
def report(count)
@@ -109,7 +109,7 @@ def format_backtrace(backtrace, example)
protected
def configuration
- Rspec.configuration
+ RSpec.configuration
end
def backtrace_line(line)
6 lib/rspec/core/formatters/base_text_formatter.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
@@ -11,14 +11,14 @@ def dump_failures
failed_examples.each_with_index do |failed_example, index|
exception = failed_example.execution_result[:exception_encountered]
padding = ' '
- if exception.is_a?(Rspec::Core::PendingExampleFixedError)
+ if exception.is_a?(RSpec::Core::PendingExampleFixedError)
output.puts "#{index.next}) #{failed_example} FIXED"
output.puts "#{padding}Expected pending '#{failed_example.metadata[:execution_result][:pending_message]}' to fail. No Error was raised."
else
output.puts "#{index.next}) #{failed_example}"
output.puts "#{padding}Failure/Error: #{read_failed_line(exception, failed_example).strip}"
exception.message.split("\n").each do |line|
- output.puts "#{padding}#{colorise(line, exception).strip}"
+ output.puts "#{padding}#{colorise(line, exception)}"
end
end
15 lib/rspec/core/formatters/documentation_formatter.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
@@ -44,15 +44,12 @@ def example_finished(example)
end
def failure_output(example, exception)
- expectation_not_met = exception.is_a?(::Rspec::Expectations::ExpectationNotMetError)
-
- message = if expectation_not_met
- "#{current_indentation}#{example.description} (FAILED)"
- else
- "#{current_indentation}#{example.description} (ERROR)"
- end
+ red("#{current_indentation}#{example.description} (FAILED - #{next_failure_index})")
+ end
- expectation_not_met ? red(message) : magenta(message)
+ def next_failure_index
+ @next_failure_index ||= 0
+ @next_failure_index += 1
end
def passed_output(example)
9 lib/rspec/core/formatters/helpers.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
@@ -8,14 +8,15 @@ module Helpers
SUB_SECOND_PRECISION = 5
DEFAULT_PRECISION = 2
- def format_seconds(float, precision = nil)
+ def format_seconds(float)
precision ||= (float < 1) ? SUB_SECOND_PRECISION : DEFAULT_PRECISION
formatted = sprintf("%.#{precision}f", float)
strip_trailing_zeroes(formatted)
end
def strip_trailing_zeroes(string)
- string.sub(/[^1-9]+$/, '')
+ stripped = string.sub(/[^1-9]+$/, '')
+ stripped.empty? ? "0" : stripped
end
end
@@ -24,4 +25,4 @@ def strip_trailing_zeroes(string)
end
-end
+end
2  lib/rspec/core/formatters/progress_formatter.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
2  lib/rspec/core/hooks.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
module Hooks
def before_blocks
2  lib/rspec/core/let.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
module Let
2  lib/rspec/core/load_path.rb
View
@@ -1,3 +1,3 @@
require 'rspec/core/ruby_project'
-Rspec::Core::RubyProject.add_to_load_path('lib', 'spec')
+RSpec::Core::RubyProject.add_to_load_path('lib', 'spec')
8 lib/rspec/core/metadata.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
class Metadata < Hash
@@ -49,12 +49,12 @@ def ensure_valid_keys(user_metadata)
#{"*"*50}
:#{key} is not allowed
-Rspec reserves some hash keys for its own internal use,
+RSpec reserves some hash keys for its own internal use,
including :#{key}, which is used on:
#{caller(0)[4]}.
-Here are all of Rspec's reserved hash keys:
+Here are all of RSpec's reserved hash keys:
#{RESERVED_KEYS.join("\n ")}
#{"*"*50}
@@ -119,7 +119,7 @@ def apply_condition(filter_on, filter, metadata=nil)
private
def world
- Rspec.world
+ RSpec.world
end
def superclass_metadata
2  lib/rspec/core/mocking/with_absolutely_nothing.rb
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Core
module MockFrameworkAdapter
2  lib/rspec/core/mocking/with_flexmock.rb
View
@@ -5,7 +5,7 @@
require 'flexmock/rspec'
-module Rspec
+module RSpec
module Core
module MockFrameworkAdapter
2  lib/rspec/core/mocking/with_mocha.rb
View
@@ -1,7 +1,7 @@
require 'mocha/standalone'
require 'mocha/object'
-module Rspec
+module RSpec
module Core
module MockFrameworkAdapter
4 lib/rspec/core/mocking/with_rr.rb
View
@@ -1,8 +1,8 @@
require 'rr'
-Rspec.configuration.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
+RSpec.configuration.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
-module Rspec
+module RSpec
module Core
module MockFrameworkAdapter
6 lib/rspec/core/mocking/with_rspec.rb
View
@@ -1,13 +1,13 @@
require 'rspec/mocks/framework'
require 'rspec/mocks/extensions'
-module Rspec
+module RSpec
module Core
module MockFrameworkAdapter
- include Rspec::Mocks::ExampleMethods
+ include RSpec::Mocks::ExampleMethods
def _setup_mocks
- $rspec_mocks ||= Rspec::Mocks::Space.new
+ $rspec_mocks ||= RSpec::Mocks::Space.new
end
def _verify_mocks
$rspec_mocks.verify_all
6 lib/rspec/core/object_extensions.rb
View
@@ -1,10 +1,10 @@
-module Rspec
+module RSpec
module Core
module ObjectExtensions
def describe(*args, &example_group_block)
args << {} unless args.last.is_a?(Hash)
args.last.update :caller => caller(1)
- Rspec::Core::ExampleGroup.describe(*args, &example_group_block)
+ RSpec::Core::ExampleGroup.describe(*args, &example_group_block)
end
alias :context :describe
@@ -12,4 +12,4 @@ def describe(*args, &example_group_block)
end
end