Permalink
Browse files

Funny thing, but turning on warnings produces a bunch of warnings. Mo…

…stly gone now.
  • Loading branch information...
1 parent 2ffa9fb commit 51893e6dc5be711b34474c8dbb35735b27895243 @dchelimsky dchelimsky committed Jan 19, 2012
@@ -122,7 +122,7 @@ def _include_controller_helpers
include ExampleMethods
metadata[:type] = :view
- helper *_default_helpers
+ helper(*_default_helpers)
before do
_include_controller_helpers
@@ -23,11 +23,11 @@ def last_response
c.include RequestInstanceMethods, :type => :request
c.before :type => :controller do
- Webrat.configure {|c| c.mode = :rails}
+ Webrat.configure {|w| w.mode = :rails}
end
c.before :type => :request do
- Webrat.configure {|c| c.mode = :rack}
+ Webrat.configure {|w| w.mode = :rack}
end
end
end
@@ -18,8 +18,8 @@
describe 'the spec' do
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe PostsController/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe PostsController/) }
end
end
describe 'skipped with a flag' do
@@ -60,14 +60,14 @@
describe 'index.html.erb' do
subject { file('spec/views/posts/index.html.erb_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "posts\/index.html.erb"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "posts\/index.html.erb"/) }
end
describe 'show.html.erb' do
subject { file('spec/views/posts/show.html.erb_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "posts\/show.html.erb"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "posts\/show.html.erb"/) }
end
end
describe 'with haml' do
@@ -77,8 +77,8 @@
describe 'index.html.haml' do
subject { file('spec/views/posts/index.html.haml_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "posts\/index.html.haml"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "posts\/index.html.haml"/) }
end
end
end
@@ -17,8 +17,8 @@
describe 'the spec' do
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe PostsHelper/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe PostsHelper/) }
end
end
describe 'skipped with a flag' do
@@ -26,19 +26,19 @@
end
subject { file('spec/requests/posts_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "GET \/posts"/ }
- it { should contain /get posts_index_path/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "GET \/posts"/) }
+ it { should contain(/get posts_index_path/) }
end
describe 'with webrat matchers' do
before do
run_generator %w(posts --webrat)
end
subject { file('spec/requests/posts_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "GET \/posts"/ }
- it { should contain /visit posts_index_path/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "GET \/posts"/) }
+ it { should contain(/visit posts_index_path/) }
end
end
end
@@ -16,17 +16,17 @@
run_generator %w(posts index show)
end
it { should exist }
- it { should contain /require "spec_helper"/ }
- it { should contain /describe "index" do/ }
- it { should contain /describe "show" do/ }
+ it { should contain(/require "spec_helper"/) }
+ it { should contain(/describe "index" do/) }
+ it { should contain(/describe "show" do/) }
end
describe 'creates placeholder when no actions specified' do
before do
run_generator %w(posts)
end
it { should exist }
- it { should contain /require "spec_helper"/ }
- it { should contain /pending "add some examples to \(or delete\)/ }
+ it { should contain(/require "spec_helper"/) }
+ it { should contain(/pending "add some examples to \(or delete\)/) }
end
end
@@ -37,12 +37,12 @@
describe 'index' do
subject { file('spec/fixtures/posts/index') }
it { should exist }
- it { should contain /Posts#index/ }
+ it { should contain(/Posts#index/) }
end
describe 'show' do
subject { file('spec/fixtures/posts/show') }
it { should exist }
- it { should contain /Posts#show/ }
+ it { should contain(/Posts#show/) }
end
end
end
@@ -26,14 +26,14 @@
subject { file('spec/models/posts_spec.rb') }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe Posts/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe Posts/) }
end
describe 'the fixtures' do
subject { file('spec/fixtures/posts.yml') }
- it { should contain Regexp.new '# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html' }
+ it { should contain(Regexp.new('# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html')) }
end
end
@@ -49,4 +49,4 @@
end
end
end
-end
+end
@@ -15,7 +15,7 @@
describe 'the spec' do
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe PostsObserver/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe PostsObserver/) }
end
end
@@ -12,8 +12,8 @@
describe 'with no options' do
before { run_generator %w(posts) }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe PostsController/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe PostsController/) }
end
describe 'with --no-controller_specs' do
@@ -25,7 +25,7 @@
describe 'namespaced controller spec' do
subject { file('spec/controllers/admin/posts_controller_spec.rb') }
before { run_generator %w(admin/posts) }
- it { should contain /describe Admin::PostsController/ }
+ it { should contain(/describe Admin::PostsController/)}
end
describe 'view specs' do
@@ -34,33 +34,33 @@
describe 'edit' do
subject { file("spec/views/posts/edit.html.erb_spec.rb") }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "(.*)\/edit"/ }
- it { should contain /it "renders the edit (.*) form"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "(.*)\/edit"/) }
+ it { should contain(/it "renders the edit (.*) form"/) }
end
describe 'index' do
subject { file("spec/views/posts/index.html.erb_spec.rb") }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "(.*)\/index"/ }
- it { should contain /it "renders a list of (.*)"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "(.*)\/index"/) }
+ it { should contain(/it "renders a list of (.*)"/) }
end
describe 'new' do
subject { file("spec/views/posts/new.html.erb_spec.rb") }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "(.*)\/new"/ }
- it { should contain /it "renders new (.*) form"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "(.*)\/new"/) }
+ it { should contain(/it "renders new (.*) form"/) }
end
describe 'show' do
subject { file("spec/views/posts/show.html.erb_spec.rb") }
it { should exist }
- it { should contain /require 'spec_helper'/ }
- it { should contain /describe "(.*)\/show"/ }
- it { should contain /it "renders attributes in <p>"/ }
+ it { should contain(/require 'spec_helper'/) }
+ it { should contain(/describe "(.*)\/show"/) }
+ it { should contain(/it "renders attributes in <p>"/) }
end
end
@@ -94,9 +94,9 @@
describe 'with default options' do
before { run_generator %w(posts) }
- it { should contain /require "spec_helper"/ }
- it { should contain /describe PostsController/ }
- it { should contain /describe "routing"/ }
+ it { should contain(/require "spec_helper"/) }
+ it { should contain(/describe PostsController/) }
+ it { should contain(/describe "routing"/) }
end
describe 'with --no-routing-specs' do
@@ -13,17 +13,17 @@
it 'generates a spec for the supplied action' do
run_generator %w(posts index)
file('spec/views/posts/index.html.erb_spec.rb').tap do |f|
- f.should contain /require 'spec_helper'/
- f.should contain /describe "posts\/index"/
+ f.should contain(/require 'spec_helper'/)
+ f.should contain(/describe "posts\/index"/)
end
end
describe 'with a nested resource' do
it 'generates a spec for the supplied action' do
run_generator %w(admin/posts index)
file('spec/views/admin/posts/index.html.erb_spec.rb').tap do |f|
- f.should contain /require 'spec_helper'/
- f.should contain /describe "admin\/posts\/index"/
+ f.should contain(/require 'spec_helper'/)
+ f.should contain(/describe "admin\/posts\/index"/)
end
end
end
@@ -33,8 +33,8 @@
it 'generates a spec for the supplied action' do
run_generator %w(posts index --template_engine haml)
file('spec/views/posts/index.html.haml_spec.rb').tap do |f|
- f.should contain /require 'spec_helper'/
- f.should contain /describe "posts\/index"/
+ f.should contain(/require 'spec_helper'/)
+ f.should contain(/describe "posts\/index"/)
end
end
end
@@ -10,7 +10,7 @@
end
it "fails if the scope encompasses more records than on the right hand side" do
- another_model = MockableModel.create
+ MockableModel.create
MockableModel.scoped.should_not =~ models.reverse
end
@@ -80,7 +80,7 @@
describe "with params" do
it "does not mutate its parameters" do
params = {:a => 'b'}
- model = mock_model(MockableModel, params)
+ mock_model(MockableModel, params)
params.should == {:a => 'b'}
end
end
View
@@ -17,6 +17,9 @@ def self.run_all(reporter=nil)
end
RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run :focus
+ config.run_all_when_everything_filtered = true
config.before(:each) do
@real_world = RSpec.world
RSpec.instance_variable_set(:@world, RSpec::Core::World.new)

0 comments on commit 51893e6

Please sign in to comment.