Using RSpec 3 for development.

This commit is contained in:
Pedro Nascimento 2014-06-17 01:54:02 -03:00 committed by Elliot Winkler
parent 1cd4a4cd12
commit 1f24f04da3
27 changed files with 331 additions and 236 deletions

View File

@ -7,6 +7,7 @@ end
rails_3 = proc do
gem 'strong_parameters'
gem 'rspec-rails', '2.99.0'
end
rails_3_1 = proc do
@ -17,6 +18,7 @@ rails_3_1 = proc do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
gem 'rspec-rails', '2.99.0'
end
rails_3_2 = proc do
@ -35,9 +37,9 @@ rails_4 = proc do
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'sdoc'
gem 'activeresource', '4.0.0'
gem 'rspec-rails', '~> 3.0.1'
# Test suite makes heavy use of attr_accessible
gem 'protected_attributes'
end
@ -78,6 +80,7 @@ if Gem::Requirement.new('> 1.9.2').satisfied_by?(ruby_version)
appraise '4.0.0' do
instance_eval(&rails_4)
gem 'rails', '4.0.0'
gem 'jbuilder', '~> 1.2'
gem 'sass-rails', '~> 4.0.0'
gem 'bcrypt-ruby', '~> 3.0.0'
end
@ -85,8 +88,10 @@ if Gem::Requirement.new('> 1.9.2').satisfied_by?(ruby_version)
appraise '4.0.1' do
instance_eval(&rails_4)
gem 'rails', '4.0.1'
gem 'jbuilder', '~> 1.2'
gem 'sass-rails', '~> 4.0.0'
gem 'bcrypt-ruby', '~> 3.1.2'
gem 'rspec-rails', '2.99.0'
end
appraise '4.1' do

View File

@ -10,7 +10,7 @@ gem 'cucumber', '~> 1.1'
gem 'pry'
gem 'rails', '~> 3.0'
gem 'rake', '>= 0.9.2'
gem 'rspec-rails', '>= 2.13.1', '< 3'
gem 'rspec-rails', '>= 2.99.0'
# YARD
gem 'yard'

View File

@ -39,29 +39,29 @@ GEM
rake
thor (>= 0.14.0)
arel (3.0.3)
aruba (0.5.3)
childprocess (~> 0.3.6)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.0.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
cucumber (1.3.10)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.9)
i18n (0.6.11)
journey (1.0.4)
json (1.8.1)
mail (2.5.4)
@ -72,8 +72,8 @@ GEM
mime-types (1.25.1)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.8.4)
multi_test (0.0.3)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
@ -86,7 +86,7 @@ GEM
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
@ -105,22 +105,26 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.1.1)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.0.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.1)
rspec-core (3.0.3)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-rails (3.0.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.3)
shoulda-context (1.2.0)
slop (3.4.7)
sprockets (2.2.2)
@ -129,7 +133,7 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.8)
thor (0.18.1)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
polyglot
@ -157,7 +161,7 @@ DEPENDENCIES
rails (~> 3.0)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (>= 2.99.0)
shoulda-context (~> 1.2.0)
shoulda-matchers!
sqlite3

View File

@ -66,6 +66,9 @@ Feature: integrate with Rails
And I write to "spec/models/user_spec.rb" with:
"""
require 'spec_helper'
if RSpec::Core::Version::STRING.to_i >= 3
require 'rails_helper'
end
describe User do
it { should validate_presence_of(:name) }
@ -74,13 +77,16 @@ Feature: integrate with Rails
When I write to "spec/controllers/examples_controller_spec.rb" with:
"""
require 'spec_helper'
if RSpec::Core::Version::STRING.to_i >= 3
require 'rails_helper'
end
describe ExamplesController, "show" do
before { get :show }
it { should respond_with(:success) }
end
"""
When I successfully run `bundle exec rake spec SPEC_OPTS=-fs --trace`
When I successfully run `bundle exec rake spec SPEC_OPTS=-fd --trace`
Then the output should contain "2 examples, 0 failures"
And the output should contain "should require name to be set"
And the output should contain "should respond with 200"
@ -96,6 +102,9 @@ Feature: integrate with Rails
And I write to "spec/models/user_spec.rb" with:
"""
require 'spec_helper'
if RSpec::Core::Version::STRING.to_i >= 3
require 'rails_helper'
end
describe User do
it { should validate_presence_of(:name) }
@ -104,6 +113,9 @@ Feature: integrate with Rails
When I write to "spec/controllers/examples_controller_spec.rb" with:
"""
require 'spec_helper'
if RSpec::Core::Version::STRING.to_i >= 3
require 'rails_helper'
end
describe ExamplesController, "show" do
before { get :show }
@ -112,7 +124,7 @@ Feature: integrate with Rails
end
"""
When I run `bundle exec spring stop`
When I successfully run `bundle exec spring rspec spec -fs`
When I successfully run `bundle exec spring rspec spec -fd`
Then the output should contain "3 examples, 0 failures"
And the output should contain "should require name to be set"
And the output should contain "should respond with 200"
@ -124,6 +136,9 @@ Feature: integrate with Rails
And I write to "spec/models/user_spec.rb" with:
"""
require 'spec_helper'
if RSpec::Core::Version::STRING.to_i == 3
require 'rails_helper'
end
describe User do
it { should validate_presence_of(:name) }
@ -140,6 +155,6 @@ Feature: integrate with Rails
end
end
"""
When I successfully run `bundle exec rake spec test:functionals SPEC_OPTS=-fs --trace`
When I successfully run `bundle exec rake spec test:functionals SPEC_OPTS=-fd --trace`
Then the output should contain "1 example, 0 failures"
Then the output should indicate that 1 test was run

View File

@ -70,14 +70,16 @@ When 'I run the rspec generator' do
end
When 'I configure the application to use rspec-rails' do
append_to_gemfile %q(gem 'rspec-rails', '~> 2.13')
append_to_gemfile <<-GEMFILE
gem 'rspec-rails', '#{rspec_rails_version}'
GEMFILE
steps %{And I install gems}
end
When 'I configure the application to use rspec-rails in test and development' do
append_to_gemfile <<-GEMFILE
group :test, :development do
gem 'rspec-rails', '~> 2.13'
gem 'rspec-rails', '#{rspec_rails_version}'
end
GEMFILE
steps %{And I install gems}
@ -90,7 +92,7 @@ When 'I configure the application to use shoulda-context' do
end
When 'I require shoulda-matchers following rspec-rails' do
insert_line_after 'spec/spec_helper.rb',
insert_line_after test_helper_path,
"require 'rspec/rails'",
"require 'shoulda/matchers'"
end
@ -204,6 +206,22 @@ module FileHelpers
def rails_lt_4?
Gem::Requirement.new('< 4').satisfied_by?(rails_version)
end
def rspec_rails_version
Bundler.definition.specs['rspec-rails'][0].version
end
def rspec_rails_gte_3?
Gem::Requirement.new('>= 3').satisfied_by?(rspec_rails_version)
end
def test_helper_path
if rspec_rails_gte_3?
'spec/rails_helper.rb'
else
'spec/spec_helper.rb'
end
end
end
World(FileHelpers)

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -22,6 +21,7 @@ gem "jdbc-sqlite3", :platform=>:jruby
gem "jruby-openssl", :platform=>:jruby
gem "therubyrhino", :platform=>:jruby
gem "strong_parameters"
gem "rspec-rails", "2.99.0"
gem "rails", "~> 3.0.17"
gemspec :path=>".././"

View File

@ -39,29 +39,30 @@ GEM
rake
thor (>= 0.14.0)
arel (2.0.10)
aruba (0.5.1)
childprocess (~> 0.3.6)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
bourne (1.4.0)
mocha (~> 0.13.2)
builder (2.1.2)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
cucumber (1.2.3)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.6)
multi_json (~> 1.3)
diff-lcs (1.2.1)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.6.6)
abstract (>= 1.0.0)
ffi (1.4.0)
gherkin (2.11.6)
json (>= 1.7.6)
i18n (0.5.0)
json (1.7.7)
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
i18n (0.5.4)
json (1.8.1)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
@ -72,7 +73,8 @@ GEM
mime-types (1.21)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.7.1)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
@ -101,21 +103,25 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (10.0.3)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
shoulda-context (1.2.0)
slop (3.4.7)
sqlite3 (1.3.7)
@ -127,7 +133,7 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
tzinfo (0.3.41)
watchr (0.7)
yajl-ruby (1.1.0)
yard (0.8.7.3)
@ -150,7 +156,7 @@ DEPENDENCIES
rails (~> 3.0.17)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
shoulda-context (~> 1.2.0)
shoulda-matchers!
sqlite3

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -28,6 +27,7 @@ gem "jquery-rails"
gem "sass-rails", "~> 3.1.5"
gem "coffee-rails", "~> 3.1.1"
gem "uglifier", ">= 1.0.3"
gem "rspec-rails", "2.99.0"
gem "turn", "~> 0.8.3"
gemspec :path=>".././"

View File

@ -41,15 +41,15 @@ GEM
rake
thor (>= 0.14.0)
arel (2.2.3)
aruba (0.5.1)
childprocess (~> 0.3.6)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
bcrypt-ruby (3.0.1)
bourne (1.4.0)
mocha (~> 0.13.2)
builder (3.0.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (3.1.1)
@ -59,23 +59,24 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.2.3)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.6)
multi_json (~> 1.3)
diff-lcs (1.2.1)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
ffi (1.4.0)
gherkin (2.11.6)
json (>= 1.7.6)
hike (1.2.1)
i18n (0.6.4)
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.11)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
json (1.8.1)
mail (2.3.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@ -85,7 +86,8 @@ GEM
mime-types (1.21)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.7.1)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
@ -100,7 +102,7 @@ GEM
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
@ -119,21 +121,25 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (10.0.3)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
sass (3.2.7)
sass-rails (3.1.6)
actionpack (~> 3.1.0)
@ -152,7 +158,7 @@ GEM
activemodel (~> 3.0)
railties (~> 3.0)
thor (0.14.6)
tilt (1.3.6)
tilt (1.3.7)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
@ -187,7 +193,7 @@ DEPENDENCIES
rails (~> 3.1.8)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
sass-rails (~> 3.1.5)
shoulda-context (~> 1.2.0)
shoulda-matchers!

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -28,6 +27,7 @@ gem "jquery-rails"
gem "sass-rails", "~> 3.1.5"
gem "coffee-rails", "~> 3.1.1"
gem "uglifier", ">= 1.0.3"
gem "rspec-rails", "2.99.0"
gem "turn", "0.8.2"
gemspec :path=>".././"

View File

@ -41,7 +41,7 @@ GEM
rake
thor (>= 0.14.0)
arel (2.2.3)
aruba (0.5.3)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
@ -49,7 +49,7 @@ GEM
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.0.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (3.1.1)
@ -59,12 +59,12 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.3.10)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
@ -72,7 +72,7 @@ GEM
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.9)
i18n (0.6.11)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
@ -86,8 +86,8 @@ GEM
mime-types (1.25.1)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.8.4)
multi_test (0.0.3)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
@ -102,7 +102,7 @@ GEM
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
@ -121,22 +121,25 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (10.1.1)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.1)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
sass (3.2.12)
sass-rails (3.1.6)
actionpack (~> 3.1.0)
@ -155,7 +158,7 @@ GEM
activemodel (~> 3.0)
railties (~> 3.0)
thor (0.14.6)
tilt (1.3.6)
tilt (1.3.7)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
@ -190,7 +193,7 @@ DEPENDENCIES
rails (~> 3.1.8)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
sass-rails (~> 3.1.5)
shoulda-context (~> 1.2.0)
shoulda-matchers!

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -22,6 +21,7 @@ gem "jdbc-sqlite3", :platform=>:jruby
gem "jruby-openssl", :platform=>:jruby
gem "therubyrhino", :platform=>:jruby
gem "strong_parameters"
gem "rspec-rails", "2.99.0"
gem "rails", "~> 3.2.13"
gem "bcrypt-ruby", "~> 3.0.0"
gem "jquery-rails"

View File

@ -39,15 +39,15 @@ GEM
rake
thor (>= 0.14.0)
arel (3.0.2)
aruba (0.5.1)
childprocess (~> 0.3.6)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
bcrypt-ruby (3.0.1)
bourne (1.4.0)
mocha (~> 0.13.2)
builder (3.0.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (3.2.2)
@ -57,24 +57,25 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.2.3)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.11.6)
multi_json (~> 1.3)
diff-lcs (1.2.1)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
ffi (1.4.0)
gherkin (2.11.6)
json (>= 1.7.6)
hike (1.2.1)
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
json (1.8.1)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@ -84,7 +85,8 @@ GEM
mime-types (1.21)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.7.1)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
pry (0.9.12.6)
@ -97,7 +99,7 @@ GEM
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
@ -116,21 +118,25 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.1.1)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
sass (3.2.7)
sass-rails (3.2.6)
railties (~> 3.2.0)
@ -151,8 +157,8 @@ GEM
actionpack (~> 3.0)
activemodel (~> 3.0)
railties (~> 3.0)
thor (0.18.1)
tilt (1.3.6)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
@ -185,7 +191,7 @@ DEPENDENCIES
rails (~> 3.2.13)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
sass-rails (~> 3.2.3)
shoulda-context (~> 1.2.0)
shoulda-matchers!

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -22,6 +21,7 @@ gem "jdbc-sqlite3", :platform=>:jruby
gem "jruby-openssl", :platform=>:jruby
gem "therubyrhino", :platform=>:jruby
gem "strong_parameters"
gem "rspec-rails", "2.99.0"
gem "rails", "~> 3.2.13"
gem "bcrypt-ruby", "~> 3.0.0"
gem "jquery-rails"

View File

@ -39,7 +39,7 @@ GEM
rake
thor (>= 0.14.0)
arel (3.0.3)
aruba (0.5.4)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
@ -57,7 +57,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.3.15)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
@ -70,7 +70,7 @@ GEM
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.9)
i18n (0.6.11)
journey (1.0.4)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
@ -123,10 +123,10 @@ GEM
redcarpet (3.1.2)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.0)
rspec-expectations (2.99.0)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.1)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
@ -188,7 +188,7 @@ DEPENDENCIES
rails (~> 3.2.13)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
sass-rails (~> 3.2.3)
shoulda-context (~> 1.2.0)
shoulda-matchers!

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -27,11 +26,12 @@ gem "uglifier", ">= 1.3.0"
gem "coffee-rails", "~> 4.0.0"
gem "jquery-rails"
gem "turbolinks"
gem "jbuilder", "~> 1.2"
gem "sdoc"
gem "activeresource", "4.0.0"
gem "rspec-rails", "~> 3.0.1"
gem "protected_attributes"
gem "rails", "4.0.0"
gem "jbuilder", "~> 1.2"
gem "sass-rails", "~> 4.0.0"
gem "bcrypt-ruby", "~> 3.0.0"

View File

@ -39,17 +39,16 @@ GEM
bundler
rake
thor (>= 0.14.0)
arel (4.0.1)
aruba (0.5.3)
arel (4.0.2)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
atomic (1.1.14)
bcrypt-ruby (3.0.1)
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.1.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
@ -59,12 +58,12 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.3.10)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
@ -72,7 +71,7 @@ GEM
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.5)
i18n (0.6.11)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
@ -89,9 +88,9 @@ GEM
minitest (4.7.5)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.8.2)
multi_test (0.0.2)
polyglot (0.3.3)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.5)
posix-spawn (0.3.8)
protected_attributes (1.0.3)
activemodel (>= 4.0.0, < 5.0)
@ -120,26 +119,32 @@ GEM
activesupport (= 4.0.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
rake (10.3.2)
rdoc (4.1.1)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.0)
rspec-core (3.0.3)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-rails (3.0.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sass (3.2.12)
sass-rails (4.0.0)
railties (>= 4.0.0.beta, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.3)
sass (3.2.19)
sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
@ -148,7 +153,7 @@ GEM
spring (1.1.3)
spring-commands-rspec (1.0.2)
spring (>= 0.9.1)
sprockets (2.10.1)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
@ -158,16 +163,15 @@ GEM
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
tzinfo (0.3.38)
tzinfo (0.3.41)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
@ -199,7 +203,7 @@ DEPENDENCIES
rails (= 4.0.0)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (~> 3.0.1)
sass-rails (~> 4.0.0)
sdoc
shoulda-context (~> 1.2.0)

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -27,12 +26,13 @@ gem "uglifier", ">= 1.3.0"
gem "coffee-rails", "~> 4.0.0"
gem "jquery-rails"
gem "turbolinks"
gem "jbuilder", "~> 1.2"
gem "sdoc"
gem "activeresource", "4.0.0"
gem "protected_attributes"
gem "rails", "4.0.1"
gem "jbuilder", "~> 1.2"
gem "sass-rails", "~> 4.0.0"
gem "bcrypt-ruby", "~> 3.1.2"
gem "rspec-rails", "2.99.0"
gemspec :path=>".././"

View File

@ -40,16 +40,15 @@ GEM
rake
thor (>= 0.14.0)
arel (4.0.1)
aruba (0.5.3)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.1.4)
childprocess (0.3.9)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
@ -59,12 +58,12 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.3.10)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
@ -72,7 +71,7 @@ GEM
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.5)
i18n (0.6.11)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
@ -89,8 +88,8 @@ GEM
minitest (4.7.5)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.8.2)
multi_test (0.0.2)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.3)
posix-spawn (0.3.8)
protected_attributes (1.0.5)
@ -120,21 +119,25 @@ GEM
activesupport (= 4.0.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
rake (10.3.2)
rdoc (4.1.1)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.1)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.0)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
sass (3.2.12)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
@ -158,16 +161,15 @@ GEM
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
tzinfo (0.3.38)
tzinfo (0.3.41)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
@ -199,7 +201,7 @@ DEPENDENCIES
rails (= 4.0.1)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (= 2.99.0)
sass-rails (~> 4.0.0)
sdoc
shoulda-context (~> 1.2.0)

View File

@ -9,7 +9,6 @@ gem "bundler", "~> 1.1"
gem "cucumber", "~> 1.1"
gem "pry"
gem "rake", ">= 0.9.2"
gem "rspec-rails", ">= 2.13.1", "< 3"
gem "yard"
gem "redcarpet"
gem "pygments.rb"
@ -27,6 +26,7 @@ gem "coffee-rails", "~> 4.0.0"
gem "jquery-rails"
gem "turbolinks"
gem "activeresource", "4.0.0"
gem "rspec-rails", "~> 3.0.1"
gem "rails", "~> 4.1.0"
gem "jbuilder", "~> 2.0"
gem "sass-rails", "~> 4.0.3"

View File

@ -42,7 +42,7 @@ GEM
rake
thor (>= 0.14.0)
arel (5.0.0)
aruba (0.5.4)
aruba (0.6.0)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
@ -50,7 +50,7 @@ GEM
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.2.2)
childprocess (0.4.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
@ -60,12 +60,12 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.7.0)
cucumber (1.3.10)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
multi_test (>= 0.1.1)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.0.2)
@ -73,7 +73,7 @@ GEM
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.9)
i18n (0.6.11)
jbuilder (2.0.6)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
@ -87,11 +87,11 @@ GEM
metaclass (0.0.2)
method_source (0.8.2)
mime-types (1.25.1)
minitest (5.3.2)
minitest (5.4.0)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.9.2)
multi_test (0.0.3)
multi_json (1.10.1)
multi_test (0.1.1)
polyglot (0.3.4)
posix-spawn (0.3.8)
protected_attributes (1.0.7)
@ -123,22 +123,26 @@ GEM
activesupport (= 4.1.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.2.2)
rake (10.3.2)
rdoc (4.1.1)
json (~> 1.4)
redcarpet (3.1.2)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.1)
rspec-core (3.0.3)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-rails (3.0.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.3)
sass (3.2.19)
sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0)
@ -164,14 +168,14 @@ GEM
sprockets (~> 2.8)
sqlite3 (1.3.9)
thor (0.19.1)
thread_safe (0.3.3)
thread_safe (0.3.4)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
tzinfo (1.1.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
@ -204,7 +208,7 @@ DEPENDENCIES
rails (~> 4.1.0)
rake (>= 0.9.2)
redcarpet
rspec-rails (>= 2.13.1, < 3)
rspec-rails (~> 3.0.1)
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
shoulda-context (~> 1.2.0)

View File

@ -72,7 +72,7 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
end
matcher = described_class.new([:name]).in_context(self).for(:create)
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
it 'is true for all the allowable attributes' do
@ -81,7 +81,7 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
end
matcher = described_class.new([:name, :age]).in_context(self).for(:create)
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
it 'is false when any attributes are not allowed' do
@ -90,14 +90,14 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
end
matcher = described_class.new([:name, :admin]).in_context(self).for(:create)
expect(matcher.matches?(@controller)).to be_false
expect(matcher.matches?(@controller)).to be false
end
it 'is false when permit is not called' do
controller_for_resource_with_strong_parameters(action: :create)
matcher = described_class.new([:name]).in_context(self).for(:create)
expect(matcher.matches?(@controller)).to be_false
expect(matcher.matches?(@controller)).to be false
end
it 'requires an action' do
@ -129,7 +129,7 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
matcher = described_class.new([:name]).
in_context(self).
for(:show, verb: :get, params: { slug: 'foo' })
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
it 'works with #update specifically' do
@ -140,7 +140,7 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
matcher = described_class.new([:name]).
in_context(self).
for(:update, params: { id: 1 })
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
it 'does not raise an error when #fetch was used instead of #require (issue #495)' do
@ -151,7 +151,7 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
matcher = described_class.new([:eta, :diner_id]).
in_context(self).
for(:create)
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
it 'tracks multiple calls to #permit' do
@ -167,12 +167,12 @@ describe Shoulda::Matchers::ActionController::StrongParametersMatcher do
matcher = described_class.new(sets_of_attributes[0]).
in_context(self).
for(:create)
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
matcher = described_class.new(sets_of_attributes[1]).
in_context(self).
for(:create)
expect(matcher.matches?(@controller)).to be_true
expect(matcher.matches?(@controller)).to be true
end
context 'stubbing params on the controller' do

View File

@ -188,7 +188,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher do
end
it 'does not match when validation uses the default message instead of given message' do
pending 'does not work'
skip 'does not work'
builder = build_object_allowing(valid_values)
@ -198,7 +198,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher do
end
it 'does not match when validation uses a message but it is not same as given' do
pending 'does not work'
skip 'does not work'
builder = build_object_allowing(valid_values, message: 'a different message')
@ -218,7 +218,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher do
end
it 'does not match when validation uses the default message instead of given message' do
pending 'does not work'
skip 'does not work'
builder = build_object_allowing(valid_values)
@ -228,7 +228,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher do
end
it 'does not match when validation uses a message but it does not match regex' do
pending 'does not work'
skip 'does not work'
builder = build_object_allowing(valid_values, message: 'a different message')

View File

@ -5,17 +5,17 @@ module Shoulda::Matchers::Doublespeak
it 'responds to any method' do
double = described_class.new
expect(double.respond_to?(:foo)).to be_true
expect(double.respond_to?(:bar)).to be_true
expect(double.respond_to?(:baz)).to be_true
expect(double.respond_to?(:foo)).to be true
expect(double.respond_to?(:bar)).to be true
expect(double.respond_to?(:baz)).to be true
end
it 'returns nil from any method call' do
double = described_class.new
expect(double.foo).to be_nil
expect(double.bar).to be_nil
expect(double.baz).to be_nil
expect(double.foo).to be nil
expect(double.bar).to be nil
expect(double.baz).to be nil
end
it 'records every method call' do

View File

@ -28,16 +28,15 @@ require 'rspec/rails'
PROJECT_ROOT = File.expand_path('../..', __FILE__)
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
Dir[ File.join(PROJECT_ROOT, 'spec/support/**/*.rb') ].each { |file| require file }
Dir[ File.join(PROJECT_ROOT, 'spec/support/**/*.rb') ].each { |file| require file }
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.mock_with :mocha
config.include Shoulda::Matchers::ActionController,
example_group: { file_path: /action_controller/ }
config.include Shoulda::Matchers::ActionController, type: :controller
end
$VERBOSE = true

View File

@ -1,4 +1,8 @@
RSpec::Matchers.define :fail_with_message_including do |expected|
def supports_block_expectations?
true
end
match do |block|
@actual = nil
@ -11,7 +15,7 @@ RSpec::Matchers.define :fail_with_message_including do |expected|
@actual && @actual.include?(expected)
end
failure_message_for_should do
def failure_message
msg = "Expectation should have failed with message including '#{expected}'"
if @actual
@ -23,11 +27,18 @@ RSpec::Matchers.define :fail_with_message_including do |expected|
msg
end
failure_message_for_should_not do
def failure_message_for_should
failure_message
end
def failure_message_when_negated
msg = "Expectation should not have failed with message including '#{expected}'"
msg << ", but did."
msg
end
end
def failure_message_for_should_not
failure_message_when_negated
end
end

View File

@ -1,4 +1,8 @@
RSpec::Matchers.define :fail_with_message do |expected|
def supports_block_expectations?
true
end
match do |block|
@actual = nil
@ -11,7 +15,7 @@ RSpec::Matchers.define :fail_with_message do |expected|
@actual && @actual == expected
end
failure_message_for_should do
def failure_message
msg = "Expectation should have failed with message '#{expected}'"
if @actual
@ -23,10 +27,18 @@ RSpec::Matchers.define :fail_with_message do |expected|
msg
end
failure_message_for_should_not do
def failure_message_for_should
failure_message
end
def failure_message_when_negated
msg = "Expectation should not have failed with message '#{expected}'"
msg << ", but did."
msg
end
def failure_message_for_should_not
failure_message_when_negated
end
end