Permalink
Browse files

change top-level module from Rspec to RSpec

  • Loading branch information...
1 parent 46b0244 commit a321c9c45f701f3dd47e168c1e9d8e4880f69bd8 @dchelimsky dchelimsky committed May 17, 2010
View
@@ -44,7 +44,7 @@ not send you to the doctor with a migraine.
## Synopsis
* each example runs in its own transaction
- * configurable in Rspec.configure
+ * configurable in RSpec.configure
* see generated spec/spec\_helper.rb
* model specs in spec/models
* controller specs in spec/controllers
View
@@ -1,15 +1,15 @@
require 'rake'
require 'yaml'
-$:.unshift File.expand_path(File.join(File.dirname(__FILE__),'lib'))
+$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'rake/rdoctask'
require 'rspec/rails/version'
require 'rspec'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
-Rspec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec)
Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = %w{--format progress}
end
@@ -18,9 +18,9 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "rspec-rails"
- gem.version = Rspec::Rails::Version::STRING
- gem.summary = "rspec-rails-#{Rspec::Rails::Version::STRING}"
- gem.description = "Rspec-2 for Rails-3"
+ gem.version = RSpec::Rails::Version::STRING
+ gem.summary = "rspec-rails-#{RSpec::Rails::Version::STRING}"
+ gem.description = "RSpec-2 for Rails-3"
gem.email = "dchelimsky@gmail.com;chad.humphries@gmail.com"
gem.homepage = "http://github.com/rspec/rspec-rails"
gem.authors = ["David Chelimsky", "Chad Humphries"]
@@ -49,7 +49,7 @@ end
namespace :gem do
desc "push to gemcutter"
task :push => :build do
- system "gem push pkg/rspec-rails-#{Rspec::Rails::Version::STRING}.gem"
+ system "gem push pkg/rspec-rails-#{RSpec::Rails::Version::STRING}.gem"
end
end
@@ -28,7 +28,7 @@ Feature: transactional examples
"""
require "spec_helper"
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.use_transactional_examples = true
end
@@ -55,7 +55,7 @@ Feature: transactional examples
"""
require "spec_helper"
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.use_transactional_examples = false
end
@@ -72,5 +72,5 @@
}
end
-class Autotest::RailsRspec2 < Autotest::Rspec2
+class Autotest::RailsRSpec2 < Autotest::RSpec2
end
View
@@ -8,6 +8,6 @@
require 'rspec/rails/example'
require 'rspec/rails/mocks'
-Rspec.configure do |c|
+RSpec.configure do |c|
c.add_option :use_transactional_examples, :type => :boolean, :default => true
end
@@ -1,7 +1,7 @@
require 'active_support/concern'
require 'test/unit/assertions'
-module Rspec
+module RSpec
module Rails
module SetupAndTeardownAdapter
def setup(*methods)
@@ -16,21 +16,21 @@ def controller_class
end
included do
- extend Rspec::Rails::SetupAndTeardownAdapter
- include Rspec::Rails::TestUnitAssertionAdapter
+ extend RSpec::Rails::SetupAndTeardownAdapter
+ include RSpec::Rails::TestUnitAssertionAdapter
include ActionController::TestCase::Behavior
include AttributeReaders
- include Rspec::Rails::ViewRendering
+ include RSpec::Rails::ViewRendering
include Webrat::Matchers
include Webrat::Methods
- include Rspec::Matchers
+ include RSpec::Matchers
before do
@routes = ::Rails.application.routes
ActionController::Base.allow_forgery_protection = false
end
end
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.include self, :example_group => { :file_path => /\bspec\/controllers\// }
end
end
@@ -4,7 +4,7 @@ module MailerExampleGroupBehaviour
extend ActiveSupport::Concern
include Webrat::Matchers
- include Rspec::Matchers
+ include RSpec::Matchers
def read_fixture(action)
IO.readlines(File.join(Rails.root, 'spec', 'fixtures', self.described_class.name.underscore, action))
@@ -21,7 +21,7 @@ def read_fixture(action)
end
end
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.include self, :example_group => { :file_path => /\bspec\/mailers\// }
end
end
@@ -6,11 +6,11 @@ module RequestExampleGroupBehaviour
include ActionDispatch::Integration::Runner
included do
- include Rspec::Rails::TestUnitAssertionAdapter
+ include RSpec::Rails::TestUnitAssertionAdapter
include ActionDispatch::Assertions
include Webrat::Matchers
include Webrat::Methods
- include Rspec::Matchers
+ include RSpec::Matchers
before do
@router = ::Rails.application.routes
@@ -29,7 +29,7 @@ def last_response
config.mode = :rack
end
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.include self, :example_group => { :file_path => /\bspec\/requests\// }
end
end
@@ -2,7 +2,7 @@
module ViewExampleGroupBehaviour
include Webrat::Matchers
- include Rspec::Matchers
+ include RSpec::Matchers
class ViewExampleController < ActionController::Base
attr_accessor :controller_path
@@ -62,7 +62,7 @@ def method_missing(selector, *args)
end
end
- Rspec.configure do |c|
+ RSpec.configure do |c|
c.include self, :example_group => { :file_path => /\bspec\/views\// }
end
@@ -1,5 +1,5 @@
if defined?(ActiveRecord::Base)
- module Rspec
+ module RSpec
module Rails
module Extensions
module ActiveRecord
@@ -38,8 +38,8 @@ def errors_on(attribute)
module ActiveRecord #:nodoc:
class Base
- extend Rspec::Rails::Extensions::ActiveRecord::ClassMethods
- include Rspec::Rails::Extensions::ActiveRecord::InstanceMethods
+ extend RSpec::Rails::Extensions::ActiveRecord::ClassMethods
+ include RSpec::Rails::Extensions::ActiveRecord::InstanceMethods
end
end
end
@@ -17,28 +17,28 @@ class AssertionFailedError < StandardError
end
-Rspec::Matchers.define :redirect_to do |destination|
+RSpec::Matchers.define :redirect_to do |destination|
match_unless_raises Test::Unit::AssertionFailedError do |_|
assert_redirected_to destination
end
end
-Rspec::Matchers.define :render_template do |options, message|
+RSpec::Matchers.define :render_template do |options, message|
match_unless_raises Test::Unit::AssertionFailedError do |_|
options = options.to_s if Symbol === options
assert_template options, message
end
end
-Rspec::Matchers.define :be_a_new do |model_klass|
+RSpec::Matchers.define :be_a_new do |model_klass|
match do |actual|
model_klass === actual && actual.new_record?
end
end
require 'rspec/matchers/have'
-module Rspec #:nodoc:
+module RSpec #:nodoc:
module Matchers #:nodoc:
class Have #:nodoc:
View
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Rails
class IllegalDataAccessException < StandardError; end
@@ -140,6 +140,6 @@ def next_id
end
end
-Rspec.configure do |c|
- c.include Rspec::Rails::Mocks
+RSpec.configure do |c|
+ c.include RSpec::Rails::Mocks
end
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Rails
class NullResolver < ActionView::PathResolver
def query(path, exts, formats)
@@ -2,7 +2,7 @@ begin
require 'rspec/core'
require 'rspec/core/rake_task'
rescue MissingSourceFile
- module Rspec
+ module RSpec
module Core
class RakeTask
def initialize(name)
@@ -36,12 +36,12 @@ task :default => :spec
task :stats => "spec:statsetup"
desc "Run all specs in spec directory (excluding plugin specs)"
-Rspec::Core::RakeTask.new(:spec => spec_prereq)
+RSpec::Core::RakeTask.new(:spec => spec_prereq)
namespace :spec do
[:requests, :models, :controllers, :views, :helpers, :mailers, :lib].each do |sub|
desc "Run the code examples in spec/#{sub}"
- Rspec::Core::RakeTask.new(sub => spec_prereq) do |t|
+ RSpec::Core::RakeTask.new(sub => spec_prereq) do |t|
t.pattern = "./spec/#{sub}/**/*_spec.rb"
end
end
@@ -1,6 +1,6 @@
require 'rspec/core'
-module Rspec
+module RSpec
module Rails
module TransactionalDatabaseSupport
@@ -9,7 +9,7 @@ def active_record_configured?
end
def use_transactional_examples?
- active_record_configured? && Rspec.configuration.use_transactional_examples?
+ active_record_configured? && RSpec.configuration.use_transactional_examples?
end
def setup_transactional_examples
@@ -34,8 +34,8 @@ def teardown_transactional_examples
end
end
-Rspec.configure do |c|
- c.include Rspec::Rails::TransactionalDatabaseSupport
+RSpec.configure do |c|
+ c.include RSpec::Rails::TransactionalDatabaseSupport
c.before { setup_transactional_examples }
c.after { teardown_transactional_examples }
end
@@ -1,4 +1,4 @@
-module Rspec # :nodoc:
+module RSpec # :nodoc:
module Rails # :nodoc:
module Version # :nodoc:
STRING = File.readlines(File.expand_path('../../../../VERSION', __FILE__)).first
@@ -1,4 +1,4 @@
-module Rspec
+module RSpec
module Rails
module ViewRendering
extend ActiveSupport::Concern
@@ -20,7 +20,7 @@ def render_views?
included do
before do
@_view_paths = controller.class.view_paths
- controller.class.view_paths = [Rspec::Rails::NullResolver.new()] unless
+ controller.class.view_paths = [RSpec::Rails::NullResolver.new()] unless
self.class.render_views?
end
View
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["David Chelimsky", "Chad Humphries"]
s.date = %q{2010-05-16}
- s.description = %q{Rspec-2 for Rails-3}
+ s.description = %q{RSpec-2 for Rails-3}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.extra_rdoc_files = [
"README.markdown"
@@ -5,7 +5,7 @@
stub_metadata(
:example_group => {:file_path => "./spec/controllers/whatever_spec.rb:15"}
)
- group = Rspec::Core::ExampleGroup.describe
+ group = RSpec::Core::ExampleGroup.describe
group.included_modules.should include(ControllerExampleGroupBehaviour)
end
end
@@ -5,7 +5,7 @@
stub_metadata(
:example_group => {:file_path => "./spec/mailers/whatever_spec.rb:15"}
)
- group = Rspec::Core::ExampleGroup.describe
+ group = RSpec::Core::ExampleGroup.describe
group.included_modules.should include(MailerExampleGroupBehaviour)
end
end
@@ -5,7 +5,7 @@
stub_metadata(
:example_group => {:file_path => "./spec/requests/whatever_spec.rb:15"}
)
- group = Rspec::Core::ExampleGroup.describe
+ group = RSpec::Core::ExampleGroup.describe
group.included_modules.should include(RequestExampleGroupBehaviour)
end
end
@@ -5,7 +5,7 @@
stub_metadata(
:example_group => {:file_path => "./spec/views/whatever_spec.rb:15"}
)
- group = Rspec::Core::ExampleGroup.describe
+ group = RSpec::Core::ExampleGroup.describe
group.included_modules.should include(ViewExampleGroupBehaviour)
end
end
Oops, something went wrong.

0 comments on commit a321c9c

Please sign in to comment.