Upgrade RSpec and other testing gems

This commit is contained in:
Cédric Boutillier 2015-09-11 15:16:23 +02:00 committed by Joshua Clayton
parent ee6caa2a6b
commit 4a4a0b90f2
15 changed files with 243 additions and 150 deletions

View File

@ -7,85 +7,96 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activerecord-jdbc-adapter (1.3.16)
activemodel (4.2.5.1)
activesupport (= 4.2.5.1)
builder (~> 3.1)
activerecord (4.2.5.1)
activemodel (= 4.2.5.1)
activesupport (= 4.2.5.1)
arel (~> 6.0)
activerecord-jdbc-adapter (1.3.19)
activerecord (>= 2.2)
activerecord-jdbcsqlite3-adapter (1.3.16)
activerecord-jdbc-adapter (~> 1.3.16)
activerecord-jdbcsqlite3-adapter (1.3.19)
activerecord-jdbc-adapter (~> 1.3.19)
jdbc-sqlite3 (>= 3.7.2, < 3.9)
activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
activesupport (4.2.5.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
appraisal (2.1.0)
bundler
rake
thor (>= 0.14.0)
arel (4.0.2)
aruba (0.5.3)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
atomic (1.1.10)
atomic (1.1.10-java)
bourne (1.5.0)
mocha (>= 0.13.2, < 0.15)
builder (3.1.4)
childprocess (0.3.9)
arel (6.0.3)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
cucumber (1.3.15)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
diff-lcs (1.1.3)
ffi (1.9.0)
ffi (1.9.0-java)
multi_test (>= 0.1.2)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
gherkin (2.12.2)
multi_json (~> 1.3)
gherkin (2.12.2-java)
multi_json (~> 1.3)
i18n (0.6.4)
jdbc-sqlite3 (3.8.7)
metaclass (0.0.1)
minitest (4.7.5)
mocha (0.14.0)
i18n (0.7.0)
jdbc-sqlite3 (3.8.11.2)
json (1.8.3)
json (1.8.3-java)
metaclass (0.0.4)
minitest (5.8.4)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.10.1)
multi_test (0.1.1)
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sqlite3 (1.3.10)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sqlite3 (1.3.11)
thor (0.19.1)
thread_safe (0.1.2)
atomic
thread_safe (0.1.2-java)
atomic
timecop (0.6.2.2)
tzinfo (0.3.37)
yard (0.8.7)
thread_safe (0.3.5)
thread_safe (0.3.5-java)
timecop (0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
yard (0.8.7.6)
PLATFORMS
java
@ -101,8 +112,12 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop
yard
BUNDLED WITH
1.11.2

View File

@ -22,7 +22,8 @@ Gem::Specification.new do |s|
s.add_dependency("activesupport", ">= 3.0.0")
s.add_development_dependency("rspec", "~> 2.12.0")
s.add_development_dependency("rspec", "~> 3.0")
s.add_development_dependency("rspec-its", "~> 1.0")
s.add_development_dependency("cucumber", "~> 1.3.15")
s.add_development_dependency("timecop")
s.add_development_dependency("simplecov")

View File

@ -8,7 +8,7 @@ end
World(FactoryGirlDefinitionsHelper)
When /^"([^"]*)" is added to FactoryGirl's file definitions path$/ do |file_name|
new_factory_file = File.join(current_dir, file_name.gsub(".rb", ""))
new_factory_file = File.join(expand_path("."), file_name.gsub(".rb", ""))
append_file_to_factory_girl_definitions_path(new_factory_file)
@ -16,7 +16,7 @@ When /^"([^"]*)" is added to FactoryGirl's file definitions path$/ do |file_name
end
When /^"([^"]*)" is added to FactoryGirl's file definitions path as an absolute path$/ do |file_name|
new_factory_file = File.expand_path(File.join(current_dir, file_name.gsub(".rb", "")))
new_factory_file = File.expand_path(File.join(expand_path("."), file_name.gsub(".rb", "")))
append_file_to_factory_girl_definitions_path(new_factory_file)

View File

@ -34,22 +34,26 @@ GEM
rake
thor (>= 0.14.0)
arel (3.0.3)
aruba (0.7.4)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.0.4)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
diff-lcs (1.1.3)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
@ -67,14 +71,22 @@ GEM
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
@ -100,8 +112,12 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop
yard
BUNDLED WITH
1.11.2

View File

@ -32,22 +32,26 @@ GEM
rake
thor (>= 0.14.0)
arel (4.0.2)
aruba (0.7.4)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.1.4)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
diff-lcs (1.1.3)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
@ -66,14 +70,22 @@ GEM
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
@ -101,8 +113,12 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop
yard
BUNDLED WITH
1.11.2

View File

@ -30,22 +30,26 @@ GEM
rake
thor (>= 0.14.0)
arel (5.0.1.20140414130214)
aruba (0.7.4)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
diff-lcs (1.1.3)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
@ -64,14 +68,22 @@ GEM
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
@ -100,8 +112,12 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop
yard
BUNDLED WITH
1.11.2

View File

@ -30,22 +30,26 @@ GEM
rake
thor (>= 0.14.0)
arel (6.0.3)
aruba (0.7.4)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
diff-lcs (1.1.3)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
@ -64,14 +68,22 @@ GEM
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
@ -100,8 +112,12 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop
yard
BUNDLED WITH
1.11.2

View File

@ -30,10 +30,13 @@ GEM
rake
thor (>= 0.14.0)
arel (7.0.0)
aruba (0.7.4)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
aruba (0.13.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
bourne (1.6.0)
mocha (~> 1.1)
builder (3.2.2)
@ -41,13 +44,14 @@ GEM
ffi (~> 1.0, >= 1.0.11)
concurrent-ruby (1.0.0)
concurrent-ruby (1.0.0-java)
contracts (0.13.0)
cucumber (1.3.20)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
diff-lcs (1.1.3)
diff-lcs (1.2.5)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-java)
@ -67,14 +71,22 @@ GEM
multi_json (1.11.2)
multi_test (0.1.2)
rake (10.5.0)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
simplecov (0.11.2)
docile (~> 1.1.0)
json (~> 1.8)
@ -103,7 +115,8 @@ DEPENDENCIES
factory_girl!
jdbc-sqlite3
mocha (>= 0.12.8)
rspec (~> 2.12.0)
rspec (~> 3.0)
rspec-its (~> 1.0)
simplecov
sqlite3 (~> 1.3.10)
timecop

View File

@ -134,7 +134,7 @@ describe "modifying factories" do
its(:name) { should eq "Great User" }
its(:email) { should eq "Great User-modified@example.com" }
its(:admin) { should be_true }
its(:admin) { should be true }
end
context "overriding dynamic attributes" do
@ -142,7 +142,7 @@ describe "modifying factories" do
its(:name) { should eq "Great User" }
its(:email) { should eq "perfect@example.com" }
its(:admin) { should be_true }
its(:admin) { should be true }
end
context "overriding static attributes" do
@ -150,7 +150,7 @@ describe "modifying factories" do
its(:name) { should eq "wonderful" }
its(:email) { should eq "wonderful-modified@example.com" }
its(:admin) { should be_true }
its(:admin) { should be true }
end
end
end

View File

@ -38,7 +38,7 @@ describe 'sequences are evaluated in the correct context' do
end
end
expect(FactoryGirl.build(:sequence_with_frozen).id).to be_false
expect(FactoryGirl.build(:sequence_with_frozen).id).to be false
end
it 'allows direct reference of a method in a sequence' do

View File

@ -241,7 +241,7 @@ describe "traits added via strategy" do
context "adding traits in create" do
subject { FactoryGirl.create(:user, :admin, :great, name: "Joe") }
its(:admin) { should be_true }
its(:admin) { should be true }
its(:name) { should eq "JOE" }
it "doesn't modify the user factory" do
@ -254,21 +254,21 @@ describe "traits added via strategy" do
context "adding traits in build" do
subject { FactoryGirl.build(:user, :admin, :great, name: "Joe") }
its(:admin) { should be_true }
its(:admin) { should be true }
its(:name) { should eq "Joe" }
end
context "adding traits in attributes_for" do
subject { FactoryGirl.attributes_for(:user, :admin, :great) }
its([:admin]) { should be_true }
its([:admin]) { should be true }
its([:name]) { should eq "John" }
end
context "adding traits in build_stubbed" do
subject { FactoryGirl.build_stubbed(:user, :admin, :great, name: "Jack") }
its(:admin) { should be_true }
its(:admin) { should be true }
its(:name) { should eq "Jack" }
end
@ -279,7 +279,7 @@ describe "traits added via strategy" do
it "creates all the records" do
subject.each do |record|
expect(record.admin).to be_true
expect(record.admin).to be true
expect(record.name).to eq "JOE"
end
end
@ -292,7 +292,7 @@ describe "traits added via strategy" do
it "builds all the records" do
subject.each do |record|
expect(record.admin).to be_true
expect(record.admin).to be true
expect(record.name).to eq "Joe"
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
share_examples_for "finds definitions" do
shared_examples_for "finds definitions" do
before do
FactoryGirl.stubs(:load)
FactoryGirl.find_definitions
@ -19,7 +19,7 @@ RSpec::Matchers.define :load_definitions_from do |file|
"load definitions from #{file}"
end
failure_message_for_should do
failure_message do
@has_received.failure_message
end
end

View File

@ -20,6 +20,6 @@ describe FactoryGirl::Strategy::Create do
evaluation = evaluation_class.new
evaluation.stubs(object: nil, notify: nil)
subject.result(evaluation)
expect(evaluation.block_run).to be_true
expect(evaluation.block_run).to be true
end
end

View File

@ -3,7 +3,7 @@ $LOAD_PATH << File.join(File.dirname(__FILE__))
require 'rubygems'
require 'rspec'
require 'rspec/autorun'
require 'rspec/its'
require "simplecov"

View File

@ -27,7 +27,7 @@ RSpec::Matchers.define :delegate do |delegated_method|
end
end
failure_message_for_should do
failure_message do
if Class === @instance
message = "expected #{@instance.name} "
prefix = '.'