foreigner-matcher 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +3 -7
- data/Gemfile +7 -3
- data/Gemfile.lock +60 -57
- data/LICENSE.txt +1 -1
- data/README.md +6 -4
- data/Rakefile +0 -1
- data/ci/config/database.yml +0 -9
- data/ci/gemfiles/{rspec2_9_rails3_0.gemfile → rspec2_13_rails3_0.gemfile} +3 -3
- data/ci/gemfiles/rspec2_13_rails3_0.gemfile.lock +94 -0
- data/ci/gemfiles/{rspec2_9_rails3_1.gemfile → rspec2_13_rails3_1.gemfile} +3 -3
- data/ci/gemfiles/rspec2_13_rails3_1.gemfile.lock +106 -0
- data/lib/foreigner-matcher/version.rb +1 -1
- data/lib/foreigner-matcher.rb +8 -10
- data/spec/spec_helper.rb +0 -1
- metadata +14 -17
- data/ci/gemfiles/rspec2_9_rails3_0.gemfile.lock +0 -94
- data/ci/gemfiles/rspec2_9_rails3_1.gemfile.lock +0 -106
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 040a77aa46e11c55687026338766c6172f5124d3
|
4
|
+
data.tar.gz: 1c4e54f5a6109bb11b15d10c62616db3452b5d34
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a9076d22605fbc18bd71cab26665b3d71e21e452938f6d460957b8be5ea1476781a43fa0ba0112e52ed4d9dd33eca5b29c1e3148602d503d5c950f7b36d8a555
|
7
|
+
data.tar.gz: 47d8ff0f6a0c7de9de8cc43f500c236ca96a4a7e7c27d24dc68d041d1ec3c26cd22771de3de65a2c66ffdbf5f30e1e2e8db9c8cd3c6a2c4cd8b5a266ebee4f2f
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
- 1.9.2
|
3
|
+
- 2.0.0
|
5
4
|
- 1.9.3
|
6
|
-
- ree
|
7
|
-
- rbx-18mode
|
8
5
|
- rbx-19mode
|
9
|
-
- jruby-18mode
|
10
6
|
- jruby-19mode
|
11
7
|
env:
|
12
8
|
- DB=mysql
|
13
9
|
- DB=postgres
|
14
10
|
gemfile:
|
15
11
|
- Gemfile
|
16
|
-
- ci/gemfiles/
|
17
|
-
- ci/gemfiles/
|
12
|
+
- ci/gemfiles/rspec2_13_rails3_1.gemfile
|
13
|
+
- ci/gemfiles/rspec2_13_rails3_0.gemfile
|
18
14
|
before_script:
|
19
15
|
- ci/script/create_db.sh
|
20
16
|
- bundle exec rake db:test:reset --trace
|
data/Gemfile
CHANGED
@@ -3,16 +3,20 @@ source "http://rubygems.org"
|
|
3
3
|
# Specify your gem's dependencies in foreigner-matcher.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
group :development do
|
7
|
+
gem "yard"
|
8
|
+
end
|
9
|
+
|
6
10
|
group :test do
|
7
11
|
gem "rake"
|
8
|
-
gem "rspec", "~> 2.
|
9
|
-
gem "mocha", "~> 0.
|
12
|
+
gem "rspec", "~> 2.13.0"
|
13
|
+
gem "mocha", "~> 0.13.0"
|
10
14
|
gem "activerecord", "~> 3.2.0"
|
11
15
|
gem "railties", "~> 3.2.0"
|
12
16
|
|
13
17
|
platforms :ruby do
|
14
18
|
gem "mysql2", "~> 0.3.0"
|
15
|
-
gem "pg", "~> 0.
|
19
|
+
gem "pg", "~> 0.15.0"
|
16
20
|
end
|
17
21
|
|
18
22
|
platforms :jruby do
|
data/Gemfile.lock
CHANGED
@@ -1,91 +1,93 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
foreigner-matcher (0.2.
|
4
|
+
foreigner-matcher (0.2.2)
|
5
5
|
foreigner (>= 1.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (3.2.
|
11
|
-
activemodel (= 3.2.
|
12
|
-
activesupport (= 3.2.
|
10
|
+
actionpack (3.2.13)
|
11
|
+
activemodel (= 3.2.13)
|
12
|
+
activesupport (= 3.2.13)
|
13
13
|
builder (~> 3.0.0)
|
14
14
|
erubis (~> 2.7.0)
|
15
|
-
journey (~> 1.0.
|
16
|
-
rack (~> 1.4.
|
15
|
+
journey (~> 1.0.4)
|
16
|
+
rack (~> 1.4.5)
|
17
17
|
rack-cache (~> 1.2)
|
18
18
|
rack-test (~> 0.6.1)
|
19
|
-
sprockets (~> 2.1
|
20
|
-
activemodel (3.2.
|
21
|
-
activesupport (= 3.2.
|
19
|
+
sprockets (~> 2.2.1)
|
20
|
+
activemodel (3.2.13)
|
21
|
+
activesupport (= 3.2.13)
|
22
22
|
builder (~> 3.0.0)
|
23
|
-
activerecord (3.2.
|
24
|
-
activemodel (= 3.2.
|
25
|
-
activesupport (= 3.2.
|
23
|
+
activerecord (3.2.13)
|
24
|
+
activemodel (= 3.2.13)
|
25
|
+
activesupport (= 3.2.13)
|
26
26
|
arel (~> 3.0.2)
|
27
27
|
tzinfo (~> 0.3.29)
|
28
|
-
activerecord-jdbc-adapter (1.2.
|
29
|
-
activerecord-jdbcmysql-adapter (1.2.
|
30
|
-
activerecord-jdbc-adapter (~> 1.2.
|
28
|
+
activerecord-jdbc-adapter (1.2.9)
|
29
|
+
activerecord-jdbcmysql-adapter (1.2.9)
|
30
|
+
activerecord-jdbc-adapter (~> 1.2.9)
|
31
31
|
jdbc-mysql (~> 5.1.0)
|
32
|
-
activerecord-jdbcpostgresql-adapter (1.2.
|
33
|
-
activerecord-jdbc-adapter (~> 1.2.
|
34
|
-
jdbc-postgres (>= 9.
|
35
|
-
activesupport (3.2.
|
36
|
-
i18n (
|
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
37
|
multi_json (~> 1.0)
|
38
38
|
arel (3.0.2)
|
39
|
-
builder (3.0.
|
40
|
-
diff-lcs (1.
|
39
|
+
builder (3.0.4)
|
40
|
+
diff-lcs (1.2.3)
|
41
41
|
erubis (2.7.0)
|
42
|
-
foreigner (1.1
|
42
|
+
foreigner (1.4.1)
|
43
43
|
activerecord (>= 3.0.0)
|
44
|
-
hike (1.2.
|
45
|
-
i18n (0.6.
|
46
|
-
jdbc-mysql (5.1.
|
47
|
-
jdbc-postgres (9.1
|
48
|
-
journey (1.0.
|
49
|
-
json (1.7.
|
50
|
-
json (1.7.
|
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
51
|
metaclass (0.0.1)
|
52
|
-
mocha (0.
|
52
|
+
mocha (0.13.3)
|
53
53
|
metaclass (~> 0.0.1)
|
54
|
-
multi_json (1.
|
54
|
+
multi_json (1.7.2)
|
55
55
|
mysql2 (0.3.11)
|
56
|
-
pg (0.
|
57
|
-
rack (1.4.
|
56
|
+
pg (0.15.1)
|
57
|
+
rack (1.4.5)
|
58
58
|
rack-cache (1.2)
|
59
59
|
rack (>= 0.4)
|
60
|
-
rack-ssl (1.3.
|
60
|
+
rack-ssl (1.3.3)
|
61
61
|
rack
|
62
|
-
rack-test (0.6.
|
62
|
+
rack-test (0.6.2)
|
63
63
|
rack (>= 1.0)
|
64
|
-
railties (3.2.
|
65
|
-
actionpack (= 3.2.
|
66
|
-
activesupport (= 3.2.
|
64
|
+
railties (3.2.13)
|
65
|
+
actionpack (= 3.2.13)
|
66
|
+
activesupport (= 3.2.13)
|
67
67
|
rack-ssl (~> 1.3.2)
|
68
68
|
rake (>= 0.8.7)
|
69
69
|
rdoc (~> 3.4)
|
70
|
-
thor (
|
71
|
-
rake (0.
|
72
|
-
rdoc (3.12)
|
70
|
+
thor (>= 0.14.6, < 2.0)
|
71
|
+
rake (10.0.4)
|
72
|
+
rdoc (3.12.2)
|
73
73
|
json (~> 1.4)
|
74
|
-
rspec (2.
|
75
|
-
rspec-core (~> 2.
|
76
|
-
rspec-expectations (~> 2.
|
77
|
-
rspec-mocks (~> 2.
|
78
|
-
rspec-core (2.
|
79
|
-
rspec-expectations (2.
|
80
|
-
diff-lcs (
|
81
|
-
rspec-mocks (2.
|
82
|
-
sprockets (2.
|
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
83
|
hike (~> 1.2)
|
84
|
+
multi_json (~> 1.0)
|
84
85
|
rack (~> 1.0)
|
85
86
|
tilt (~> 1.1, != 1.3.0)
|
86
|
-
thor (0.
|
87
|
-
tilt (1.3.
|
88
|
-
tzinfo (0.3.
|
87
|
+
thor (0.18.1)
|
88
|
+
tilt (1.3.7)
|
89
|
+
tzinfo (0.3.37)
|
90
|
+
yard (0.8.6)
|
89
91
|
|
90
92
|
PLATFORMS
|
91
93
|
java
|
@@ -96,9 +98,10 @@ DEPENDENCIES
|
|
96
98
|
activerecord-jdbcmysql-adapter
|
97
99
|
activerecord-jdbcpostgresql-adapter
|
98
100
|
foreigner-matcher!
|
99
|
-
mocha (~> 0.
|
101
|
+
mocha (~> 0.13.0)
|
100
102
|
mysql2 (~> 0.3.0)
|
101
|
-
pg (~> 0.
|
103
|
+
pg (~> 0.15.0)
|
102
104
|
railties (~> 3.2.0)
|
103
105
|
rake
|
104
|
-
rspec (~> 2.
|
106
|
+
rspec (~> 2.13.0)
|
107
|
+
yard
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# foreigner-matcher
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/foreigner-matcher.png)](http://badge.fury.io/rb/foreigner-matcher)
|
3
4
|
[![Build Status](https://secure.travis-ci.org/yellow5/foreigner-matcher.png?branch=master)](http://travis-ci.org/yellow5/foreigner-matcher)
|
5
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/yellow5/foreigner-matcher)
|
4
6
|
|
5
7
|
RSpec matcher for the [Foreigner gem](https://github.com/matthuhiggins/foreigner), inspired by [Remarkable](https://github.com/remarkable/remarkable) ActiveRecord matchers.
|
6
8
|
|
@@ -88,10 +90,10 @@ The project is tested on [Travis-CI](https://github.com/travis-ci/travis-ci). Th
|
|
88
90
|
|
89
91
|
The current gems that are tested:
|
90
92
|
|
91
|
-
* ActiveRecord ~> 3.2.0, Rspec ~> 2.
|
92
|
-
* ActiveRecord ~> 3.1.0, Rspec ~> 2.
|
93
|
-
* ActiveRecord ~> 3.0.0, Rspec ~> 2.
|
93
|
+
* ActiveRecord ~> 3.2.0, Rspec ~> 2.13.0, Foreigner >= 1.00
|
94
|
+
* ActiveRecord ~> 3.1.0, Rspec ~> 2.13.0, Foreigner >= 1.00
|
95
|
+
* ActiveRecord ~> 3.0.0, Rspec ~> 2.13.0, Foreigner >= 1.00
|
94
96
|
|
95
97
|
## Copyright
|
96
98
|
|
97
|
-
Copyright (c) 2011 Cameron Dykes. See LICENSE.txt for further details.
|
99
|
+
Copyright (c) 2011-2013 Cameron Dykes. See LICENSE.txt for further details.
|
data/Rakefile
CHANGED
@@ -29,7 +29,6 @@ namespace :db do
|
|
29
29
|
db_config_yml << '/config/database.yml'
|
30
30
|
db_configs = YAML::load(File.open(db_config_yml))
|
31
31
|
db_adapter = ENV['DB']
|
32
|
-
db_adapter = 'jdbc-' + db_adapter if RUBY_PLATFORM == 'java'
|
33
32
|
db_config = db_configs[db_adapter]
|
34
33
|
ActiveRecord::Base.configurations = db_configs
|
35
34
|
ActiveRecord::Base.establish_connection(db_config)
|
data/ci/config/database.yml
CHANGED
@@ -3,16 +3,7 @@ mysql:
|
|
3
3
|
database: foreigner-matcher_test
|
4
4
|
username: root
|
5
5
|
encoding: utf8
|
6
|
-
jdbc-mysql:
|
7
|
-
adapter: jdbcmysql
|
8
|
-
database: foreigner-matcher_test
|
9
|
-
username: root
|
10
|
-
encoding: utf8
|
11
6
|
postgres:
|
12
7
|
adapter: postgresql
|
13
8
|
database: foreigner-matcher_test
|
14
9
|
username: postgres
|
15
|
-
jdbc-postgres:
|
16
|
-
adapter: jdbcpostgresql
|
17
|
-
database: foreigner-matcher_test
|
18
|
-
username: postgres
|
@@ -5,14 +5,14 @@ gemspec :path => '../../'
|
|
5
5
|
|
6
6
|
group :test do
|
7
7
|
gem "rake"
|
8
|
-
gem "rspec", "~> 2.
|
9
|
-
gem "mocha", "~> 0.
|
8
|
+
gem "rspec", "~> 2.13.0"
|
9
|
+
gem "mocha", "~> 0.13.0"
|
10
10
|
gem "activerecord", "~> 3.0.0"
|
11
11
|
gem "railties", "~> 3.0.0"
|
12
12
|
|
13
13
|
platforms :ruby do
|
14
14
|
gem "mysql2", "~> 0.2.0"
|
15
|
-
gem "pg", "~> 0.
|
15
|
+
gem "pg", "~> 0.15.0"
|
16
16
|
end
|
17
17
|
|
18
18
|
platforms :jruby do
|
@@ -0,0 +1,94 @@
|
|
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)
|
@@ -5,14 +5,14 @@ gemspec :path => '../../'
|
|
5
5
|
|
6
6
|
group :test do
|
7
7
|
gem "rake"
|
8
|
-
gem "rspec", "~> 2.
|
9
|
-
gem "mocha", "~> 0.
|
8
|
+
gem "rspec", "~> 2.13.0"
|
9
|
+
gem "mocha", "~> 0.13.0"
|
10
10
|
gem "activerecord", "~> 3.1.0"
|
11
11
|
gem "railties", "~> 3.1.0"
|
12
12
|
|
13
13
|
platforms :ruby do
|
14
14
|
gem "mysql2", "~> 0.3.0"
|
15
|
-
gem "pg", "~> 0.
|
15
|
+
gem "pg", "~> 0.15.0"
|
16
16
|
end
|
17
17
|
|
18
18
|
platforms :jruby do
|
@@ -0,0 +1,106 @@
|
|
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)
|
data/lib/foreigner-matcher.rb
CHANGED
@@ -36,7 +36,7 @@ module ForeignerMatcher # :nodoc:
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def child_foreign_keys
|
39
|
-
@child.connection.foreign_keys(@child.class.table_name)
|
39
|
+
@child.class.connection.foreign_keys(@child.class.table_name)
|
40
40
|
end
|
41
41
|
|
42
42
|
def ordered_options
|
@@ -53,26 +53,24 @@ module ForeignerMatcher # :nodoc:
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def postgresql_db?
|
56
|
-
|
56
|
+
@child.class.connection.adapter_name.downcase == 'postgresql'
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
# Ensures that parent table has foreign key
|
61
61
|
#
|
62
|
-
#
|
63
|
-
#
|
62
|
+
# @param [Symbol] parent the table to check for foreign key
|
63
|
+
# @param [Hash] options accepts any option that works with add_foreign_key in Foreigner
|
64
64
|
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# :name Foreign key index name (default: #{@child.class.table_name}_#{@parent.singularize}_id)
|
65
|
+
# @option options [String] :primary_key ('id') column referenced on parent table
|
66
|
+
# @option options [String] :column (@parent.singluarize + '_id') foreign key column
|
67
|
+
# @option options [String] :name (@child.class.table_name + '_' + @parent.singularize + '_id') foreign key index name
|
69
68
|
#
|
70
|
-
#
|
69
|
+
# @example
|
71
70
|
# it { should have_foreign_key_for(:users) }
|
72
71
|
# it { should have_foreign_key_for(:users, :dependent => :delete) }
|
73
72
|
# it { should have_foreign_key_for(:users, :column => "some_column_name", :name => "users_some_column_name_fk") }
|
74
73
|
# it { should_not have_foreign_key_for(:users, :dependent => :nullify) }
|
75
|
-
|
76
74
|
def have_foreign_key_for(parent, options={})
|
77
75
|
HaveForeignKeyFor.new(parent, options)
|
78
76
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,6 @@ db_config_yml << '/../ci' if ENV['TRAVIS']
|
|
10
10
|
db_config_yml << '/config/database.yml'
|
11
11
|
db_configs = YAML::load(File.open(db_config_yml))
|
12
12
|
db_adapter = ENV['DB']
|
13
|
-
db_adapter = 'jdbc-' + db_adapter if RUBY_PLATFORM == 'java'
|
14
13
|
db_config = db_configs[db_adapter]
|
15
14
|
ActiveRecord::Base.configurations = db_configs
|
16
15
|
ActiveRecord::Base.establish_connection(db_config)
|
metadata
CHANGED
@@ -1,30 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreigner-matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Cameron Dykes
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: foreigner
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.0.0
|
30
27
|
description: Adds rspec matcher to verify the presence of foreign keys generated by
|
@@ -43,10 +40,10 @@ files:
|
|
43
40
|
- README.md
|
44
41
|
- Rakefile
|
45
42
|
- ci/config/database.yml
|
46
|
-
- ci/gemfiles/
|
47
|
-
- ci/gemfiles/
|
48
|
-
- ci/gemfiles/
|
49
|
-
- ci/gemfiles/
|
43
|
+
- ci/gemfiles/rspec2_13_rails3_0.gemfile
|
44
|
+
- ci/gemfiles/rspec2_13_rails3_0.gemfile.lock
|
45
|
+
- ci/gemfiles/rspec2_13_rails3_1.gemfile
|
46
|
+
- ci/gemfiles/rspec2_13_rails3_1.gemfile.lock
|
50
47
|
- ci/script/create_db.sh
|
51
48
|
- foreigner-matcher.gemspec
|
52
49
|
- lib/foreigner-matcher.rb
|
@@ -67,26 +64,26 @@ files:
|
|
67
64
|
- spec/test_models/user_type_spec.rb
|
68
65
|
homepage: https://github.com/yellow5/foreigner-matcher
|
69
66
|
licenses: []
|
67
|
+
metadata: {}
|
70
68
|
post_install_message:
|
71
69
|
rdoc_options: []
|
72
70
|
require_paths:
|
73
71
|
- lib
|
74
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
73
|
requirements:
|
77
|
-
- -
|
74
|
+
- - '>='
|
78
75
|
- !ruby/object:Gem::Version
|
79
76
|
version: '0'
|
80
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
78
|
requirements:
|
83
|
-
- -
|
79
|
+
- - '>='
|
84
80
|
- !ruby/object:Gem::Version
|
85
81
|
version: '0'
|
86
82
|
requirements: []
|
87
83
|
rubyforge_project: foreigner-matcher
|
88
|
-
rubygems_version:
|
84
|
+
rubygems_version: 2.0.3
|
89
85
|
signing_key:
|
90
|
-
specification_version:
|
86
|
+
specification_version: 4
|
91
87
|
summary: Rspec matcher for testing the presence of foreign keys generated by Foreigner
|
92
88
|
test_files: []
|
89
|
+
has_rdoc:
|
@@ -1,94 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /home/cameron/projects/my_stuff/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.12)
|
12
|
-
activemodel (= 3.0.12)
|
13
|
-
activesupport (= 3.0.12)
|
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.12)
|
22
|
-
activesupport (= 3.0.12)
|
23
|
-
builder (~> 2.1.2)
|
24
|
-
i18n (~> 0.5.0)
|
25
|
-
activerecord (3.0.12)
|
26
|
-
activemodel (= 3.0.12)
|
27
|
-
activesupport (= 3.0.12)
|
28
|
-
arel (~> 2.0.10)
|
29
|
-
tzinfo (~> 0.3.23)
|
30
|
-
activerecord-jdbc-adapter (1.2.2)
|
31
|
-
activerecord-jdbcmysql-adapter (1.2.2)
|
32
|
-
activerecord-jdbc-adapter (~> 1.2.2)
|
33
|
-
jdbc-mysql (~> 5.1.0)
|
34
|
-
activerecord-jdbcpostgresql-adapter (1.2.2)
|
35
|
-
activerecord-jdbc-adapter (~> 1.2.2)
|
36
|
-
jdbc-postgres (>= 9.0, < 9.2)
|
37
|
-
activesupport (3.0.12)
|
38
|
-
arel (2.0.10)
|
39
|
-
builder (2.1.2)
|
40
|
-
diff-lcs (1.1.3)
|
41
|
-
erubis (2.6.6)
|
42
|
-
abstract (>= 1.0.0)
|
43
|
-
foreigner (1.1.6)
|
44
|
-
activerecord (>= 3.0.0)
|
45
|
-
i18n (0.5.0)
|
46
|
-
jdbc-mysql (5.1.13)
|
47
|
-
jdbc-postgres (9.1.901)
|
48
|
-
json (1.7.0)
|
49
|
-
json (1.7.0-java)
|
50
|
-
metaclass (0.0.1)
|
51
|
-
mocha (0.11.3)
|
52
|
-
metaclass (~> 0.0.1)
|
53
|
-
mysql2 (0.2.18)
|
54
|
-
pg (0.13.2)
|
55
|
-
rack (1.2.5)
|
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.12)
|
61
|
-
actionpack (= 3.0.12)
|
62
|
-
activesupport (= 3.0.12)
|
63
|
-
rake (>= 0.8.7)
|
64
|
-
rdoc (~> 3.4)
|
65
|
-
thor (~> 0.14.4)
|
66
|
-
rake (0.9.2.2)
|
67
|
-
rdoc (3.12)
|
68
|
-
json (~> 1.4)
|
69
|
-
rspec (2.9.0)
|
70
|
-
rspec-core (~> 2.9.0)
|
71
|
-
rspec-expectations (~> 2.9.0)
|
72
|
-
rspec-mocks (~> 2.9.0)
|
73
|
-
rspec-core (2.9.0)
|
74
|
-
rspec-expectations (2.9.1)
|
75
|
-
diff-lcs (~> 1.1.3)
|
76
|
-
rspec-mocks (2.9.0)
|
77
|
-
thor (0.14.6)
|
78
|
-
tzinfo (0.3.33)
|
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.11.0)
|
90
|
-
mysql2 (~> 0.2.0)
|
91
|
-
pg (~> 0.13.2)
|
92
|
-
railties (~> 3.0.0)
|
93
|
-
rake
|
94
|
-
rspec (~> 2.9.0)
|
@@ -1,106 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /home/cameron/projects/my_stuff/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.4)
|
11
|
-
activemodel (= 3.1.4)
|
12
|
-
activesupport (= 3.1.4)
|
13
|
-
builder (~> 3.0.0)
|
14
|
-
erubis (~> 2.7.0)
|
15
|
-
i18n (~> 0.6)
|
16
|
-
rack (~> 1.3.6)
|
17
|
-
rack-cache (~> 1.1)
|
18
|
-
rack-mount (~> 0.8.2)
|
19
|
-
rack-test (~> 0.6.1)
|
20
|
-
sprockets (~> 2.0.3)
|
21
|
-
activemodel (3.1.4)
|
22
|
-
activesupport (= 3.1.4)
|
23
|
-
builder (~> 3.0.0)
|
24
|
-
i18n (~> 0.6)
|
25
|
-
activerecord (3.1.4)
|
26
|
-
activemodel (= 3.1.4)
|
27
|
-
activesupport (= 3.1.4)
|
28
|
-
arel (~> 2.2.3)
|
29
|
-
tzinfo (~> 0.3.29)
|
30
|
-
activerecord-jdbc-adapter (1.2.2)
|
31
|
-
activerecord-jdbcmysql-adapter (1.2.2)
|
32
|
-
activerecord-jdbc-adapter (~> 1.2.2)
|
33
|
-
jdbc-mysql (~> 5.1.0)
|
34
|
-
activerecord-jdbcpostgresql-adapter (1.2.2)
|
35
|
-
activerecord-jdbc-adapter (~> 1.2.2)
|
36
|
-
jdbc-postgres (>= 9.0, < 9.2)
|
37
|
-
activesupport (3.1.4)
|
38
|
-
multi_json (~> 1.0)
|
39
|
-
arel (2.2.3)
|
40
|
-
builder (3.0.0)
|
41
|
-
diff-lcs (1.1.3)
|
42
|
-
erubis (2.7.0)
|
43
|
-
foreigner (1.1.6)
|
44
|
-
activerecord (>= 3.0.0)
|
45
|
-
hike (1.2.1)
|
46
|
-
i18n (0.6.0)
|
47
|
-
jdbc-mysql (5.1.13)
|
48
|
-
jdbc-postgres (9.1.901)
|
49
|
-
json (1.7.0)
|
50
|
-
json (1.7.0-java)
|
51
|
-
metaclass (0.0.1)
|
52
|
-
mocha (0.11.3)
|
53
|
-
metaclass (~> 0.0.1)
|
54
|
-
multi_json (1.3.4)
|
55
|
-
mysql2 (0.3.11)
|
56
|
-
pg (0.13.2)
|
57
|
-
rack (1.3.6)
|
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.2)
|
63
|
-
rack
|
64
|
-
rack-test (0.6.1)
|
65
|
-
rack (>= 1.0)
|
66
|
-
railties (3.1.4)
|
67
|
-
actionpack (= 3.1.4)
|
68
|
-
activesupport (= 3.1.4)
|
69
|
-
rack-ssl (~> 1.3.2)
|
70
|
-
rake (>= 0.8.7)
|
71
|
-
rdoc (~> 3.4)
|
72
|
-
thor (~> 0.14.6)
|
73
|
-
rake (0.9.2.2)
|
74
|
-
rdoc (3.12)
|
75
|
-
json (~> 1.4)
|
76
|
-
rspec (2.9.0)
|
77
|
-
rspec-core (~> 2.9.0)
|
78
|
-
rspec-expectations (~> 2.9.0)
|
79
|
-
rspec-mocks (~> 2.9.0)
|
80
|
-
rspec-core (2.9.0)
|
81
|
-
rspec-expectations (2.9.1)
|
82
|
-
diff-lcs (~> 1.1.3)
|
83
|
-
rspec-mocks (2.9.0)
|
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.3)
|
90
|
-
tzinfo (0.3.33)
|
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.11.0)
|
102
|
-
mysql2 (~> 0.3.0)
|
103
|
-
pg (~> 0.13.2)
|
104
|
-
railties (~> 3.1.0)
|
105
|
-
rake
|
106
|
-
rspec (~> 2.9.0)
|