Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleanup whitespace

  • Loading branch information...
commit 96a29c48595d9ba92e405bbd4ac90db4ce6bbe38 1 parent e063c45
@dchelimsky dchelimsky authored
View
4 lib/autotest/rails_rspec2.rb
@@ -29,9 +29,9 @@
%w{config/ coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins vendor/gems}.each do |exception|
at.add_exception("^#{exception}")
end
-
+
at.clear_mappings
-
+
at.add_mapping(%r%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
["spec/models/#{m[2].singularize}_spec.rb"] + at.files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
}
View
2  lib/generators/rspec/controller/controller_generator.rb
@@ -18,7 +18,7 @@ def create_controller_files
def create_view_files
return if actions.empty?
- return unless options[:views]
+ return unless options[:views]
empty_directory File.join("spec", "views", file_path)
View
2  lib/generators/rspec/helper/templates/helper_spec.rb
@@ -2,7 +2,7 @@
# Specs in this file have access to a helper object that includes
# the <%= class_name %>Helper. For example:
-#
+#
# describe <%= class_name %>Helper do
# describe "string concat" do
# it "concats two strings with spaces" do
View
6 lib/generators/rspec/scaffold/templates/routing_spec.rb
@@ -22,15 +22,15 @@
end
it "recognizes and generates #create" do
- { :post => "/<%= table_name %>" }.should route_to(:controller => "<%= table_name %>", :action => "create")
+ { :post => "/<%= table_name %>" }.should route_to(:controller => "<%= table_name %>", :action => "create")
end
it "recognizes and generates #update" do
- { :put => "/<%= table_name %>/1" }.should route_to(:controller => "<%= table_name %>", :action => "update", :id => "1")
+ { :put => "/<%= table_name %>/1" }.should route_to(:controller => "<%= table_name %>", :action => "update", :id => "1")
end
it "recognizes and generates #destroy" do
- { :delete => "/<%= table_name %>/1" }.should route_to(:controller => "<%= table_name %>", :action => "destroy", :id => "1")
+ { :delete => "/<%= table_name %>/1" }.should route_to(:controller => "<%= table_name %>", :action => "destroy", :id => "1")
end
end
View
4 lib/rspec/rails/example/controller_example_group.rb
@@ -4,7 +4,7 @@ module RSpec::Rails
# == Examples
#
# == with stubs
- #
+ #
# describe WidgetsController do
# describe "GET index" do
# it "assigns all widgets to @widgets" do
@@ -69,7 +69,7 @@ module RSpec::Rails
# describe WidgetsController do
# render_views
# ...
- #
+ #
module ControllerExampleGroup
extend ActiveSupport::Concern
extend RSpec::Rails::ModuleInclusion
View
2  lib/rspec/rails/example/view_example_group.rb
@@ -45,7 +45,7 @@ def _default_helpers
module InstanceMethods
# :call-seq:
- # render
+ # render
# render(:template => "widgets/new.html.erb")
# render({:partial => "widgets/widget.html.erb"}, {... locals ...})
# render({:partial => "widgets/widget.html.erb"}, {... locals ...}) do ... end
View
2  lib/rspec/rails/extensions/active_record/base.rb
@@ -35,7 +35,7 @@ def errors_on(attribute)
end
end
end
-
+
module ActiveRecord #:nodoc:
class Base
extend RSpec::Rails::Extensions::ActiveRecord::ClassMethods
View
6 lib/rspec/rails/fixture_support.rb
@@ -9,13 +9,13 @@ module FixtureSupport
included do
if RSpec.configuration.use_transactional_fixtures
# TODO - figure out how to move this outside the included block
- include ActiveRecord::TestFixtures
+ include ActiveRecord::TestFixtures
- self.fixture_path = RSpec.configuration.fixture_path
+ self.fixture_path = RSpec.configuration.fixture_path
self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
- end
+ end
end
end
end
View
2  lib/rspec/rails/matchers/have_extension.rb
@@ -10,7 +10,7 @@ def failure_message_for_should_with_errors_on_extensions
return failure_message_for_should_without_errors_on_extensions
end
alias_method_chain :failure_message_for_should, :errors_on_extensions
-
+
def description_with_errors_on_extensions
return "have #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}" if @collection_name == :errors_on
return "have #{relativities[@relativity]}#{@expected} error on :#{@args[0]}" if @collection_name == :error_on
View
6 lib/rspec/rails/mocks.rb
@@ -27,7 +27,7 @@ def destroy
self.stub(:id) { nil }
end
end
-
+
# Creates a mock object instance for a +model_class+ with common
# methods stubbed out. Additional methods may be easily stubbed (via
# add_stubs) if +stubs+ is passed.
@@ -73,7 +73,7 @@ def @object.model_name
yield m if block_given?
m
end
-
+
module ModelStubber
def connection
raise Spec::Rails::IllegalDataAccessException.new("stubbed models are not allowed to access the database")
@@ -136,7 +136,7 @@ def stub_model(model_class, stubs={})
yield m if block_given?
end
end
-
+
private
@@model_id = 1000
View
2  lib/rspec/rails/view_rendering.rb
@@ -51,7 +51,7 @@ def find_all(*args)
@controller.class.view_paths = ::ActionView::PathSet.new.push(@_path_set_delegator_resolver)
end
end
-
+
after do
unless self.class.render_views?
@controller.class.view_paths = @_path_set_delegator_resolver.path_set
View
4 spec/rspec/rails/matchers/errors_on_spec.rb
@@ -4,7 +4,7 @@
it "should provide a description including the name of what the error is on" do
have(1).error_on(:whatever).description.should == "have 1 error on :whatever"
end
-
+
it "should provide a failure message including the number actually given" do
lambda {
[].should have(1).error_on(:whatever)
@@ -16,7 +16,7 @@
it "should provide a description including the name of what the error is on" do
have(2).errors_on(:whatever).description.should == "have 2 errors on :whatever"
end
-
+
it "should provide a failure message including the number actually given" do
lambda {
[1].should have(3).errors_on(:whatever)
View
2  spec/rspec/rails/matchers/route_to_spec.rb
@@ -35,7 +35,7 @@
end
context "with should_not" do
-
+
it "passes if routes do not recognize the path" do
routes.stub(:recognize_path) { raise ActionController::RoutingError.new('ignore') }
expect do
View
18 spec/rspec/rails/mocks/stub_model_spec.rb
@@ -6,28 +6,28 @@
it "should have an id" do
stub_model(MockableModel).id.should be > 0
end
-
+
it "should say it is not a new record" do
stub_model(MockableModel).should_not be_new_record
end
end
-
+
it "should accept a stub id" do
stub_model(MockableModel, :id => 37).id.should == 37
end
-
+
it "should say it is a new record when id is set to nil" do
stub_model(MockableModel, :id => nil).should be_new_record
end
-
+
it "should accept any arbitrary stub" do
stub_model(MockableModel, :foo => "bar").foo.should == "bar"
end
-
+
it "should accept a stub for save" do
stub_model(MockableModel, :save => false).save.should be(false)
end
-
+
describe "#as_new_record" do
it "should say it is a new record" do
stub_model(MockableModel).as_new_record.should be_new_record
@@ -37,20 +37,20 @@
stub_model(MockableModel).as_new_record.id.should be(nil)
end
end
-
+
pending "should raise when hitting the db" do
lambda do
model = stub_model(MockableModel, :changed => true, :attributes_with_quotes => {'this' => 'that'})
model.save
end.should raise_error(RSpec::Rails::IllegalDataAccessException, /stubbed models are not allowed to access the database/)
end
-
+
it "should increment the id" do
first = stub_model(MockableModel)
second = stub_model(MockableModel)
second.id.should == (first.id + 1)
end
-
+
describe "as association" do
before(:each) do
@real = AssociatedModel.create!
Please sign in to comment.
Something went wrong with that request. Please try again.