foreigner-matcher 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.travis.yml +9 -3
- data/Gemfile +9 -5
- data/LICENSE.txt +1 -1
- data/README.md +13 -8
- data/Rakefile +1 -0
- data/ci/gemfiles/{rspec2_13_rails3_1.gemfile → rspec2_14_rails3_2.gemfile} +5 -5
- data/ci/gemfiles/rspec2_14_rails4_0.gemfile +30 -0
- data/ci/gemfiles/rspec2_14_rails4_1.gemfile +30 -0
- data/ci/gemfiles/{rspec2_13_rails3_0.gemfile → rspec3_0_rails3_2.gemfile} +6 -6
- data/ci/gemfiles/rspec3_0_rails4_0.gemfile +30 -0
- data/lib/foreigner-matcher.rb +2 -2
- data/lib/foreigner-matcher/version.rb +1 -1
- data/spec/config/database.yml.example +16 -5
- data/spec/foreigner_matcher_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -0
- data/spec/test_models/comment_spec.rb +4 -4
- data/spec/test_models/default_option_spec.rb +4 -4
- data/spec/test_models/search_spec.rb +4 -4
- data/spec/test_models/special_user_record_spec.rb +4 -4
- data/spec/test_models/table_without_foreign_key_spec.rb +4 -4
- data/spec/test_models/user_login_spec.rb +4 -4
- data/spec/test_models/user_type_spec.rb +4 -4
- metadata +14 -14
- data/Gemfile.lock +0 -107
- data/ci/gemfiles/rspec2_13_rails3_0.gemfile.lock +0 -94
- data/ci/gemfiles/rspec2_13_rails3_1.gemfile.lock +0 -106
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 003311de0552432296c6a96b9d04d7255ec9974e
|
4
|
+
data.tar.gz: edb7647f47ca9b0124063505c6e9da9d58cccd40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f51ee71fc3c33ec01b7f09a932e02d5d6af1df3bfd9a236c2d283bc0533704b39adbdb6ea449e3a9b44a1982e101a51cb0aceaaab214ad1b32dc1cc75904c25
|
7
|
+
data.tar.gz: c3f4a9ba2c5bae57bc256ffd8b8b3a28cbc11ce0cc5d58c986faa918f2747f9aea21a7ed7864978cce82a8558bc30b9d396c10cecb91beef672c312161ff1926
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
+
- 2.1.2
|
4
|
+
- 2.1.1
|
5
|
+
- 2.1.0
|
3
6
|
- 2.0.0
|
4
7
|
- 1.9.3
|
5
|
-
- rbx-
|
8
|
+
- rbx-2
|
6
9
|
- jruby-19mode
|
7
10
|
env:
|
8
11
|
- DB=mysql
|
9
12
|
- DB=postgres
|
10
13
|
gemfile:
|
11
14
|
- Gemfile
|
12
|
-
- ci/gemfiles/
|
13
|
-
- ci/gemfiles/
|
15
|
+
- ci/gemfiles/rspec2_14_rails4_1.gemfile
|
16
|
+
- ci/gemfiles/rspec2_14_rails4_0.gemfile
|
17
|
+
- ci/gemfiles/rspec2_14_rails3_2.gemfile
|
18
|
+
- ci/gemfiles/rspec3_0_rails4_0.gemfile
|
19
|
+
- ci/gemfiles/rspec3_0_rails3_2.gemfile
|
14
20
|
before_script:
|
15
21
|
- ci/script/create_db.sh
|
16
22
|
- bundle exec rake db:test:reset --trace
|
data/Gemfile
CHANGED
@@ -7,16 +7,20 @@ group :development do
|
|
7
7
|
gem "yard"
|
8
8
|
end
|
9
9
|
|
10
|
+
group :development, :test do
|
11
|
+
gem "pry"
|
12
|
+
end
|
13
|
+
|
10
14
|
group :test do
|
11
15
|
gem "rake"
|
12
|
-
gem "rspec", "~>
|
13
|
-
gem "mocha", "~>
|
14
|
-
gem "activerecord", "~>
|
15
|
-
gem "railties", "~>
|
16
|
+
gem "rspec", "~> 3.0.0"
|
17
|
+
gem "mocha", "~> 1.1.0"
|
18
|
+
gem "activerecord", "~> 4.1.0"
|
19
|
+
gem "railties", "~> 4.1.0"
|
16
20
|
|
17
21
|
platforms :ruby do
|
18
22
|
gem "mysql2", "~> 0.3.0"
|
19
|
-
gem "pg", "~> 0.
|
23
|
+
gem "pg", "~> 0.17.0"
|
20
24
|
end
|
21
25
|
|
22
26
|
platforms :jruby do
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -8,11 +8,13 @@ RSpec matcher for the [Foreigner gem](https://github.com/matthuhiggins/foreigner
|
|
8
8
|
|
9
9
|
## Version Information
|
10
10
|
|
11
|
-
|
11
|
+
The 0.3.x verison should accompany use of [RSpec 3.0](https://github.com/rspec/rspec). The same version should be safe to use with RSpec 2.14.x as well.
|
12
12
|
|
13
|
-
|
13
|
+
Note that Foreigner >= 1.0.0 is Rails 3.x and higher only!
|
14
14
|
|
15
|
-
|
15
|
+
**Rails 4.x + 3.x**
|
16
|
+
|
17
|
+
Foreigner >= 1.0.0 use foreigner-matcher ~> 0.3.0
|
16
18
|
|
17
19
|
Foreigner ~> 0.9 use foreigner-matcher ~> 0.1.1
|
18
20
|
|
@@ -26,7 +28,7 @@ Use foreigner-matcher ~> 0.1.1
|
|
26
28
|
|
27
29
|
For installation with bundler, add the following to the approrpriate group in your Gemfile:
|
28
30
|
|
29
|
-
gem "foreigner-matcher", "~> 0.
|
31
|
+
gem "foreigner-matcher", "~> 0.3.0", :require => nil
|
30
32
|
|
31
33
|
For installation without bundler in Rails 2.3, add the following to your config/environments/test.rb:
|
32
34
|
|
@@ -90,10 +92,13 @@ The project is tested on [Travis-CI](https://github.com/travis-ci/travis-ci). Th
|
|
90
92
|
|
91
93
|
The current gems that are tested:
|
92
94
|
|
93
|
-
* ActiveRecord ~>
|
94
|
-
* ActiveRecord ~>
|
95
|
-
* ActiveRecord ~>
|
95
|
+
* ActiveRecord ~> 4.1.0, Rspec ~> 3.0.0, Foreigner >= 1.00
|
96
|
+
* ActiveRecord ~> 4.1.0, Rspec ~> 2.14.0, Foreigner >= 1.00
|
97
|
+
* ActiveRecord ~> 4.0.0, Rspec ~> 3.0.0, Foreigner >= 1.00
|
98
|
+
* ActiveRecord ~> 4.0.0, Rspec ~> 2.14.0, Foreigner >= 1.00
|
99
|
+
* ActiveRecord ~> 3.2.0, Rspec ~> 3.0.0, Foreigner >= 1.00
|
100
|
+
* ActiveRecord ~> 3.2.0, Rspec ~> 2.14.0, Foreigner >= 1.00
|
96
101
|
|
97
102
|
## Copyright
|
98
103
|
|
99
|
-
Copyright (c) 2011-
|
104
|
+
Copyright (c) 2011-2014 Cameron Dykes. See LICENSE.txt for further details.
|
data/Rakefile
CHANGED
@@ -5,14 +5,14 @@ gemspec :path => '../../'
|
|
5
5
|
|
6
6
|
group :test do
|
7
7
|
gem "rake"
|
8
|
-
gem "rspec", "~> 2.
|
9
|
-
gem "mocha", "~>
|
10
|
-
gem "activerecord", "~> 3.
|
11
|
-
gem "railties", "~> 3.
|
8
|
+
gem "rspec", "~> 2.14.0"
|
9
|
+
gem "mocha", "~> 1.1.0"
|
10
|
+
gem "activerecord", "~> 3.2.0"
|
11
|
+
gem "railties", "~> 3.2.0"
|
12
12
|
|
13
13
|
platforms :ruby do
|
14
14
|
gem "mysql2", "~> 0.3.0"
|
15
|
-
gem "pg", "~> 0.
|
15
|
+
gem "pg", "~> 0.17.0"
|
16
16
|
end
|
17
17
|
|
18
18
|
platforms :jruby do
|
@@ -0,0 +1,30 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in foreigner-matcher.gemspec
|
4
|
+
gemspec :path => '../../'
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem "yard"
|
8
|
+
end
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem "pry"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem "rake"
|
16
|
+
gem "rspec", "~> 2.14.0"
|
17
|
+
gem "mocha", "~> 1.1.0"
|
18
|
+
gem "activerecord", "~> 4.0.0"
|
19
|
+
gem "railties", "~> 4.0.0"
|
20
|
+
|
21
|
+
platforms :ruby do
|
22
|
+
gem "mysql2", "~> 0.3.0"
|
23
|
+
gem "pg", "~> 0.17.0"
|
24
|
+
end
|
25
|
+
|
26
|
+
platforms :jruby do
|
27
|
+
gem "activerecord-jdbcmysql-adapter"
|
28
|
+
gem "activerecord-jdbcpostgresql-adapter"
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in foreigner-matcher.gemspec
|
4
|
+
gemspec :path => '../../'
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem "yard"
|
8
|
+
end
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem "pry"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem "rake"
|
16
|
+
gem "rspec", "~> 2.14.0"
|
17
|
+
gem "mocha", "~> 1.1.0"
|
18
|
+
gem "activerecord", "~> 4.1.0"
|
19
|
+
gem "railties", "~> 4.1.0"
|
20
|
+
|
21
|
+
platforms :ruby do
|
22
|
+
gem "mysql2", "~> 0.3.0"
|
23
|
+
gem "pg", "~> 0.17.0"
|
24
|
+
end
|
25
|
+
|
26
|
+
platforms :jruby do
|
27
|
+
gem "activerecord-jdbcmysql-adapter"
|
28
|
+
gem "activerecord-jdbcpostgresql-adapter"
|
29
|
+
end
|
30
|
+
end
|
@@ -5,14 +5,14 @@ gemspec :path => '../../'
|
|
5
5
|
|
6
6
|
group :test do
|
7
7
|
gem "rake"
|
8
|
-
gem "rspec", "~>
|
9
|
-
gem "mocha", "~>
|
10
|
-
gem "activerecord", "~> 3.
|
11
|
-
gem "railties", "~> 3.
|
8
|
+
gem "rspec", "~> 3.0.0"
|
9
|
+
gem "mocha", "~> 1.1.0"
|
10
|
+
gem "activerecord", "~> 3.2.0"
|
11
|
+
gem "railties", "~> 3.2.0"
|
12
12
|
|
13
13
|
platforms :ruby do
|
14
|
-
gem "mysql2", "~> 0.
|
15
|
-
gem "pg", "~> 0.
|
14
|
+
gem "mysql2", "~> 0.3.0"
|
15
|
+
gem "pg", "~> 0.17.0"
|
16
16
|
end
|
17
17
|
|
18
18
|
platforms :jruby do
|
@@ -0,0 +1,30 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in foreigner-matcher.gemspec
|
4
|
+
gemspec :path => '../../'
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem "yard"
|
8
|
+
end
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem "pry"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem "rake"
|
16
|
+
gem "rspec", "~> 3.0.0"
|
17
|
+
gem "mocha", "~> 1.1.0"
|
18
|
+
gem "activerecord", "~> 4.0.0"
|
19
|
+
gem "railties", "~> 4.0.0"
|
20
|
+
|
21
|
+
platforms :ruby do
|
22
|
+
gem "mysql2", "~> 0.3.0"
|
23
|
+
gem "pg", "~> 0.17.0"
|
24
|
+
end
|
25
|
+
|
26
|
+
platforms :jruby do
|
27
|
+
gem "activerecord-jdbcmysql-adapter"
|
28
|
+
gem "activerecord-jdbcpostgresql-adapter"
|
29
|
+
end
|
30
|
+
end
|
data/lib/foreigner-matcher.rb
CHANGED
@@ -17,11 +17,11 @@ module ForeignerMatcher # :nodoc:
|
|
17
17
|
desc
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def failure_message
|
21
21
|
"expected #{display_child_foreign_keys} to include #{foreign_key_definition}"
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def failure_message_when_negated
|
25
25
|
"expected #{display_child_foreign_keys} to exclude #{foreign_key_definition}"
|
26
26
|
end
|
27
27
|
|
@@ -1,6 +1,17 @@
|
|
1
1
|
# This example shows what should be included in your database.yml.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
|
3
|
+
# For MySQL
|
4
|
+
mysql:
|
5
|
+
database: foreigner-matcher_test
|
6
|
+
adapter: mysql2
|
7
|
+
username: user
|
8
|
+
password: password
|
9
|
+
host: localhost
|
10
|
+
|
11
|
+
# For Postgres
|
12
|
+
postgres:
|
13
|
+
database: foreigner-matcher_test
|
14
|
+
adapter: postgresql
|
15
|
+
username: user
|
16
|
+
password: password
|
17
|
+
host: localhost
|
@@ -4,7 +4,7 @@ describe ForeignerMatcher::HaveForeignKeyFor do
|
|
4
4
|
describe 'methods' do
|
5
5
|
subject { ForeignerMatcher::HaveForeignKeyFor.new(mock) }
|
6
6
|
|
7
|
-
[ :matches?, :description, :
|
7
|
+
[ :matches?, :description, :failure_message, :failure_message_when_negated ].each do |klass_method|
|
8
8
|
it "should respond to #{klass_method}" do
|
9
9
|
subject.should respond_to(klass_method)
|
10
10
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'active_record'
|
3
3
|
require 'foreigner-matcher'
|
4
|
+
require 'rails'
|
4
5
|
require 'rails/railtie'
|
5
6
|
require 'foreigner'
|
6
7
|
|
@@ -28,6 +29,13 @@ end
|
|
28
29
|
|
29
30
|
# Configure rspec options
|
30
31
|
RSpec.configure do |config|
|
32
|
+
|
33
|
+
# Explicitly allow the old `object.should` syntax. We disallow the new
|
34
|
+
# `expect(object)` syntax for now to enforce consistency.
|
35
|
+
config.expect_with :rspec do |c|
|
36
|
+
c.syntax = :should
|
37
|
+
end
|
38
|
+
|
31
39
|
config.mock_framework = :mocha
|
32
40
|
|
33
41
|
config.include(ConnectionHelpers)
|
@@ -7,18 +7,18 @@ describe Comment do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users with {:dependent=>:delete}'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:comments)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('comments')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users, :dependent => :delete)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('comments')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -7,18 +7,18 @@ describe DefaultOption do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:default_options)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('default_options')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('default_options')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -7,18 +7,18 @@ describe Search do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users with {:dependent=>:delete, :name=>"user_search_special_fk"}'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:searches)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('searches')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users, :name => 'user_search_special_fk', :dependent => :delete)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('searches')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -7,18 +7,18 @@ describe SpecialUserRecord do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users with {:column=>"special_user_id", :dependent=>:delete, :name=>"special_user_records_special_user_id_fk"}'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:special_user_records)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('special_user_records')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users, :column => 'special_user_id', :name => 'special_user_records_special_user_id_fk', :dependent => :delete)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('special_user_records')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -8,16 +8,16 @@ describe TableWithoutForeignKey do
|
|
8
8
|
matcher.description.should == 'have a foreign key for users'
|
9
9
|
end
|
10
10
|
|
11
|
-
it 'should set
|
11
|
+
it 'should set failure_message message' do
|
12
12
|
stub_fkd_to_s_with('expected fk')
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected foreign keys to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher.matches?(subject)
|
20
|
-
matcher.
|
20
|
+
matcher.failure_message_when_negated.should == "expected foreign keys to exclude unexpected fk"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -7,18 +7,18 @@ describe UserLogin do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users with {:dependent=>:nullify}'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:user_logins)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('user_logins')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users, :dependent => :nullify)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('user_logins')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -7,18 +7,18 @@ describe UserType do
|
|
7
7
|
matcher.description.should == 'have a foreign key for users'
|
8
8
|
end
|
9
9
|
|
10
|
-
it 'should set
|
10
|
+
it 'should set failure_message message' do
|
11
11
|
stub_fkd_to_s_with('expected fk')
|
12
12
|
matcher = have_foreign_key_for(:user_types)
|
13
13
|
matcher.matches?(subject)
|
14
|
-
matcher.
|
14
|
+
matcher.failure_message.should == "expected #{foreign_keys_for('user_types')} to include expected fk"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should set
|
17
|
+
it 'should set failure_message_when_negated message' do
|
18
18
|
stub_fkd_to_s_with('unexpected fk')
|
19
19
|
matcher = have_foreign_key_for(:users)
|
20
20
|
matcher.matches?(subject)
|
21
|
-
matcher.
|
21
|
+
matcher.failure_message_when_negated.should == "expected #{foreign_keys_for('user_types')} to exclude unexpected fk"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreigner-matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreigner
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.0
|
27
27
|
description: Adds rspec matcher to verify the presence of foreign keys generated by
|
@@ -32,18 +32,18 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
-
- .gitignore
|
36
|
-
- .travis.yml
|
35
|
+
- ".gitignore"
|
36
|
+
- ".travis.yml"
|
37
37
|
- Gemfile
|
38
|
-
- Gemfile.lock
|
39
38
|
- LICENSE.txt
|
40
39
|
- README.md
|
41
40
|
- Rakefile
|
42
41
|
- ci/config/database.yml
|
43
|
-
- ci/gemfiles/
|
44
|
-
- ci/gemfiles/
|
45
|
-
- ci/gemfiles/
|
46
|
-
- ci/gemfiles/
|
42
|
+
- ci/gemfiles/rspec2_14_rails3_2.gemfile
|
43
|
+
- ci/gemfiles/rspec2_14_rails4_0.gemfile
|
44
|
+
- ci/gemfiles/rspec2_14_rails4_1.gemfile
|
45
|
+
- ci/gemfiles/rspec3_0_rails3_2.gemfile
|
46
|
+
- ci/gemfiles/rspec3_0_rails4_0.gemfile
|
47
47
|
- ci/script/create_db.sh
|
48
48
|
- foreigner-matcher.gemspec
|
49
49
|
- lib/foreigner-matcher.rb
|
@@ -71,17 +71,17 @@ require_paths:
|
|
71
71
|
- lib
|
72
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project: foreigner-matcher
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.2.2
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Rspec matcher for testing the presence of foreign keys generated by Foreigner
|
data/Gemfile.lock
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
foreigner-matcher (0.2.3)
|
5
|
-
foreigner (>= 1.0.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actionpack (3.2.13)
|
11
|
-
activemodel (= 3.2.13)
|
12
|
-
activesupport (= 3.2.13)
|
13
|
-
builder (~> 3.0.0)
|
14
|
-
erubis (~> 2.7.0)
|
15
|
-
journey (~> 1.0.4)
|
16
|
-
rack (~> 1.4.5)
|
17
|
-
rack-cache (~> 1.2)
|
18
|
-
rack-test (~> 0.6.1)
|
19
|
-
sprockets (~> 2.2.1)
|
20
|
-
activemodel (3.2.13)
|
21
|
-
activesupport (= 3.2.13)
|
22
|
-
builder (~> 3.0.0)
|
23
|
-
activerecord (3.2.13)
|
24
|
-
activemodel (= 3.2.13)
|
25
|
-
activesupport (= 3.2.13)
|
26
|
-
arel (~> 3.0.2)
|
27
|
-
tzinfo (~> 0.3.29)
|
28
|
-
activerecord-jdbc-adapter (1.2.9)
|
29
|
-
activerecord-jdbcmysql-adapter (1.2.9)
|
30
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
31
|
-
jdbc-mysql (~> 5.1.0)
|
32
|
-
activerecord-jdbcpostgresql-adapter (1.2.9)
|
33
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
34
|
-
jdbc-postgres (>= 9.1, < 9.3)
|
35
|
-
activesupport (3.2.13)
|
36
|
-
i18n (= 0.6.1)
|
37
|
-
multi_json (~> 1.0)
|
38
|
-
arel (3.0.2)
|
39
|
-
builder (3.0.4)
|
40
|
-
diff-lcs (1.2.3)
|
41
|
-
erubis (2.7.0)
|
42
|
-
foreigner (1.4.2)
|
43
|
-
activerecord (>= 3.0.0)
|
44
|
-
hike (1.2.2)
|
45
|
-
i18n (0.6.1)
|
46
|
-
jdbc-mysql (5.1.24)
|
47
|
-
jdbc-postgres (9.2.1002.1)
|
48
|
-
journey (1.0.4)
|
49
|
-
json (1.7.7)
|
50
|
-
json (1.7.7-java)
|
51
|
-
metaclass (0.0.1)
|
52
|
-
mocha (0.13.3)
|
53
|
-
metaclass (~> 0.0.1)
|
54
|
-
multi_json (1.7.7)
|
55
|
-
mysql2 (0.3.11)
|
56
|
-
pg (0.15.1)
|
57
|
-
rack (1.4.5)
|
58
|
-
rack-cache (1.2)
|
59
|
-
rack (>= 0.4)
|
60
|
-
rack-ssl (1.3.3)
|
61
|
-
rack
|
62
|
-
rack-test (0.6.2)
|
63
|
-
rack (>= 1.0)
|
64
|
-
railties (3.2.13)
|
65
|
-
actionpack (= 3.2.13)
|
66
|
-
activesupport (= 3.2.13)
|
67
|
-
rack-ssl (~> 1.3.2)
|
68
|
-
rake (>= 0.8.7)
|
69
|
-
rdoc (~> 3.4)
|
70
|
-
thor (>= 0.14.6, < 2.0)
|
71
|
-
rake (10.0.4)
|
72
|
-
rdoc (3.12.2)
|
73
|
-
json (~> 1.4)
|
74
|
-
rspec (2.13.0)
|
75
|
-
rspec-core (~> 2.13.0)
|
76
|
-
rspec-expectations (~> 2.13.0)
|
77
|
-
rspec-mocks (~> 2.13.0)
|
78
|
-
rspec-core (2.13.1)
|
79
|
-
rspec-expectations (2.13.0)
|
80
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
81
|
-
rspec-mocks (2.13.1)
|
82
|
-
sprockets (2.2.2)
|
83
|
-
hike (~> 1.2)
|
84
|
-
multi_json (~> 1.0)
|
85
|
-
rack (~> 1.0)
|
86
|
-
tilt (~> 1.1, != 1.3.0)
|
87
|
-
thor (0.18.1)
|
88
|
-
tilt (1.3.7)
|
89
|
-
tzinfo (0.3.37)
|
90
|
-
yard (0.8.6)
|
91
|
-
|
92
|
-
PLATFORMS
|
93
|
-
java
|
94
|
-
ruby
|
95
|
-
|
96
|
-
DEPENDENCIES
|
97
|
-
activerecord (~> 3.2.0)
|
98
|
-
activerecord-jdbcmysql-adapter
|
99
|
-
activerecord-jdbcpostgresql-adapter
|
100
|
-
foreigner-matcher!
|
101
|
-
mocha (~> 0.13.0)
|
102
|
-
mysql2 (~> 0.3.0)
|
103
|
-
pg (~> 0.15.0)
|
104
|
-
railties (~> 3.2.0)
|
105
|
-
rake
|
106
|
-
rspec (~> 2.13.0)
|
107
|
-
yard
|
@@ -1,94 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /home/cameron/projects/my_stuff/ruby/foreigner-matcher
|
3
|
-
specs:
|
4
|
-
foreigner-matcher (0.2.1)
|
5
|
-
foreigner (>= 1.0.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
abstract (1.0.0)
|
11
|
-
actionpack (3.0.20)
|
12
|
-
activemodel (= 3.0.20)
|
13
|
-
activesupport (= 3.0.20)
|
14
|
-
builder (~> 2.1.2)
|
15
|
-
erubis (~> 2.6.6)
|
16
|
-
i18n (~> 0.5.0)
|
17
|
-
rack (~> 1.2.5)
|
18
|
-
rack-mount (~> 0.6.14)
|
19
|
-
rack-test (~> 0.5.7)
|
20
|
-
tzinfo (~> 0.3.23)
|
21
|
-
activemodel (3.0.20)
|
22
|
-
activesupport (= 3.0.20)
|
23
|
-
builder (~> 2.1.2)
|
24
|
-
i18n (~> 0.5.0)
|
25
|
-
activerecord (3.0.20)
|
26
|
-
activemodel (= 3.0.20)
|
27
|
-
activesupport (= 3.0.20)
|
28
|
-
arel (~> 2.0.10)
|
29
|
-
tzinfo (~> 0.3.23)
|
30
|
-
activerecord-jdbc-adapter (1.2.9)
|
31
|
-
activerecord-jdbcmysql-adapter (1.2.9)
|
32
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
33
|
-
jdbc-mysql (~> 5.1.0)
|
34
|
-
activerecord-jdbcpostgresql-adapter (1.2.9)
|
35
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
36
|
-
jdbc-postgres (>= 9.1, < 9.3)
|
37
|
-
activesupport (3.0.20)
|
38
|
-
arel (2.0.10)
|
39
|
-
builder (2.1.2)
|
40
|
-
diff-lcs (1.2.3)
|
41
|
-
erubis (2.6.6)
|
42
|
-
abstract (>= 1.0.0)
|
43
|
-
foreigner (1.4.1)
|
44
|
-
activerecord (>= 3.0.0)
|
45
|
-
i18n (0.5.0)
|
46
|
-
jdbc-mysql (5.1.24)
|
47
|
-
jdbc-postgres (9.2.1002.1)
|
48
|
-
json (1.7.7)
|
49
|
-
json (1.7.7-java)
|
50
|
-
metaclass (0.0.1)
|
51
|
-
mocha (0.13.3)
|
52
|
-
metaclass (~> 0.0.1)
|
53
|
-
mysql2 (0.2.18)
|
54
|
-
pg (0.15.1)
|
55
|
-
rack (1.2.8)
|
56
|
-
rack-mount (0.6.14)
|
57
|
-
rack (>= 1.0.0)
|
58
|
-
rack-test (0.5.7)
|
59
|
-
rack (>= 1.0)
|
60
|
-
railties (3.0.20)
|
61
|
-
actionpack (= 3.0.20)
|
62
|
-
activesupport (= 3.0.20)
|
63
|
-
rake (>= 0.8.7)
|
64
|
-
rdoc (~> 3.4)
|
65
|
-
thor (~> 0.14.4)
|
66
|
-
rake (10.0.4)
|
67
|
-
rdoc (3.12.2)
|
68
|
-
json (~> 1.4)
|
69
|
-
rspec (2.13.0)
|
70
|
-
rspec-core (~> 2.13.0)
|
71
|
-
rspec-expectations (~> 2.13.0)
|
72
|
-
rspec-mocks (~> 2.13.0)
|
73
|
-
rspec-core (2.13.1)
|
74
|
-
rspec-expectations (2.13.0)
|
75
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
76
|
-
rspec-mocks (2.13.1)
|
77
|
-
thor (0.14.6)
|
78
|
-
tzinfo (0.3.37)
|
79
|
-
|
80
|
-
PLATFORMS
|
81
|
-
java
|
82
|
-
ruby
|
83
|
-
|
84
|
-
DEPENDENCIES
|
85
|
-
activerecord (~> 3.0.0)
|
86
|
-
activerecord-jdbcmysql-adapter
|
87
|
-
activerecord-jdbcpostgresql-adapter
|
88
|
-
foreigner-matcher!
|
89
|
-
mocha (~> 0.13.0)
|
90
|
-
mysql2 (~> 0.2.0)
|
91
|
-
pg (~> 0.15.0)
|
92
|
-
railties (~> 3.0.0)
|
93
|
-
rake
|
94
|
-
rspec (~> 2.13.0)
|
@@ -1,106 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /home/cameron/projects/my_stuff/ruby/foreigner-matcher
|
3
|
-
specs:
|
4
|
-
foreigner-matcher (0.2.1)
|
5
|
-
foreigner (>= 1.0.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actionpack (3.1.12)
|
11
|
-
activemodel (= 3.1.12)
|
12
|
-
activesupport (= 3.1.12)
|
13
|
-
builder (~> 3.0.0)
|
14
|
-
erubis (~> 2.7.0)
|
15
|
-
i18n (~> 0.6)
|
16
|
-
rack (~> 1.3.6)
|
17
|
-
rack-cache (~> 1.2)
|
18
|
-
rack-mount (~> 0.8.2)
|
19
|
-
rack-test (~> 0.6.1)
|
20
|
-
sprockets (~> 2.0.4)
|
21
|
-
activemodel (3.1.12)
|
22
|
-
activesupport (= 3.1.12)
|
23
|
-
builder (~> 3.0.0)
|
24
|
-
i18n (~> 0.6)
|
25
|
-
activerecord (3.1.12)
|
26
|
-
activemodel (= 3.1.12)
|
27
|
-
activesupport (= 3.1.12)
|
28
|
-
arel (~> 2.2.3)
|
29
|
-
tzinfo (~> 0.3.29)
|
30
|
-
activerecord-jdbc-adapter (1.2.9)
|
31
|
-
activerecord-jdbcmysql-adapter (1.2.9)
|
32
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
33
|
-
jdbc-mysql (~> 5.1.0)
|
34
|
-
activerecord-jdbcpostgresql-adapter (1.2.9)
|
35
|
-
activerecord-jdbc-adapter (~> 1.2.9)
|
36
|
-
jdbc-postgres (>= 9.1, < 9.3)
|
37
|
-
activesupport (3.1.12)
|
38
|
-
multi_json (~> 1.0)
|
39
|
-
arel (2.2.3)
|
40
|
-
builder (3.0.4)
|
41
|
-
diff-lcs (1.2.3)
|
42
|
-
erubis (2.7.0)
|
43
|
-
foreigner (1.4.1)
|
44
|
-
activerecord (>= 3.0.0)
|
45
|
-
hike (1.2.2)
|
46
|
-
i18n (0.6.4)
|
47
|
-
jdbc-mysql (5.1.24)
|
48
|
-
jdbc-postgres (9.2.1002.1)
|
49
|
-
json (1.7.7)
|
50
|
-
json (1.7.7-java)
|
51
|
-
metaclass (0.0.1)
|
52
|
-
mocha (0.13.3)
|
53
|
-
metaclass (~> 0.0.1)
|
54
|
-
multi_json (1.7.2)
|
55
|
-
mysql2 (0.3.11)
|
56
|
-
pg (0.15.1)
|
57
|
-
rack (1.3.10)
|
58
|
-
rack-cache (1.2)
|
59
|
-
rack (>= 0.4)
|
60
|
-
rack-mount (0.8.3)
|
61
|
-
rack (>= 1.0.0)
|
62
|
-
rack-ssl (1.3.3)
|
63
|
-
rack
|
64
|
-
rack-test (0.6.2)
|
65
|
-
rack (>= 1.0)
|
66
|
-
railties (3.1.12)
|
67
|
-
actionpack (= 3.1.12)
|
68
|
-
activesupport (= 3.1.12)
|
69
|
-
rack-ssl (~> 1.3.2)
|
70
|
-
rake (>= 0.8.7)
|
71
|
-
rdoc (~> 3.4)
|
72
|
-
thor (~> 0.14.6)
|
73
|
-
rake (10.0.4)
|
74
|
-
rdoc (3.12.2)
|
75
|
-
json (~> 1.4)
|
76
|
-
rspec (2.13.0)
|
77
|
-
rspec-core (~> 2.13.0)
|
78
|
-
rspec-expectations (~> 2.13.0)
|
79
|
-
rspec-mocks (~> 2.13.0)
|
80
|
-
rspec-core (2.13.1)
|
81
|
-
rspec-expectations (2.13.0)
|
82
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
83
|
-
rspec-mocks (2.13.1)
|
84
|
-
sprockets (2.0.4)
|
85
|
-
hike (~> 1.2)
|
86
|
-
rack (~> 1.0)
|
87
|
-
tilt (~> 1.1, != 1.3.0)
|
88
|
-
thor (0.14.6)
|
89
|
-
tilt (1.3.7)
|
90
|
-
tzinfo (0.3.37)
|
91
|
-
|
92
|
-
PLATFORMS
|
93
|
-
java
|
94
|
-
ruby
|
95
|
-
|
96
|
-
DEPENDENCIES
|
97
|
-
activerecord (~> 3.1.0)
|
98
|
-
activerecord-jdbcmysql-adapter
|
99
|
-
activerecord-jdbcpostgresql-adapter
|
100
|
-
foreigner-matcher!
|
101
|
-
mocha (~> 0.13.0)
|
102
|
-
mysql2 (~> 0.3.0)
|
103
|
-
pg (~> 0.15.0)
|
104
|
-
railties (~> 3.1.0)
|
105
|
-
rake
|
106
|
-
rspec (~> 2.13.0)
|