foreigner-matcher 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +40 -13
- data/README.md +21 -5
- data/Rakefile +4 -0
- data/foreigner-matcher.gemspec +1 -1
- data/lib/foreigner-matcher/version.rb +1 -1
- data/spec/spec_helper.rb +4 -2
- metadata +7 -9
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,30 +1,56 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
foreigner-matcher (0.0
|
5
|
-
foreigner (
|
4
|
+
foreigner-matcher (0.2.0)
|
5
|
+
foreigner (>= 1.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
10
|
+
abstract (1.0.0)
|
11
|
+
actionpack (3.0.10)
|
12
|
+
activemodel (= 3.0.10)
|
13
|
+
activesupport (= 3.0.10)
|
12
14
|
builder (~> 2.1.2)
|
15
|
+
erubis (~> 2.6.6)
|
13
16
|
i18n (~> 0.5.0)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
rack (~> 1.2.1)
|
18
|
+
rack-mount (~> 0.6.14)
|
19
|
+
rack-test (~> 0.5.7)
|
20
|
+
tzinfo (~> 0.3.23)
|
21
|
+
activemodel (3.0.10)
|
22
|
+
activesupport (= 3.0.10)
|
23
|
+
builder (~> 2.1.2)
|
24
|
+
i18n (~> 0.5.0)
|
25
|
+
activerecord (3.0.10)
|
26
|
+
activemodel (= 3.0.10)
|
27
|
+
activesupport (= 3.0.10)
|
17
28
|
arel (~> 2.0.10)
|
18
29
|
tzinfo (~> 0.3.23)
|
19
|
-
activesupport (3.0.
|
30
|
+
activesupport (3.0.10)
|
20
31
|
arel (2.0.10)
|
21
32
|
builder (2.1.2)
|
22
33
|
diff-lcs (1.1.2)
|
23
|
-
|
34
|
+
erubis (2.6.6)
|
35
|
+
abstract (>= 1.0.0)
|
36
|
+
foreigner (1.1.1)
|
37
|
+
activerecord (>= 3.0.0)
|
24
38
|
i18n (0.5.0)
|
25
39
|
kramdown (0.13.3)
|
26
|
-
|
27
|
-
|
40
|
+
mysql2 (0.2.13)
|
41
|
+
rack (1.2.3)
|
42
|
+
rack-mount (0.6.14)
|
43
|
+
rack (>= 1.0.0)
|
44
|
+
rack-test (0.5.7)
|
45
|
+
rack (>= 1.0)
|
46
|
+
railties (3.0.10)
|
47
|
+
actionpack (= 3.0.10)
|
48
|
+
activesupport (= 3.0.10)
|
49
|
+
rake (>= 0.8.7)
|
50
|
+
rdoc (~> 3.4)
|
51
|
+
thor (~> 0.14.4)
|
52
|
+
rake (0.9.2)
|
53
|
+
rdoc (3.9.3)
|
28
54
|
rspec (2.6.0)
|
29
55
|
rspec-core (~> 2.6.0)
|
30
56
|
rspec-expectations (~> 2.6.0)
|
@@ -33,7 +59,8 @@ GEM
|
|
33
59
|
rspec-expectations (2.6.0)
|
34
60
|
diff-lcs (~> 1.1.2)
|
35
61
|
rspec-mocks (2.6.0)
|
36
|
-
|
62
|
+
thor (0.14.6)
|
63
|
+
tzinfo (0.3.29)
|
37
64
|
|
38
65
|
PLATFORMS
|
39
66
|
ruby
|
@@ -42,6 +69,6 @@ DEPENDENCIES
|
|
42
69
|
activerecord (~> 3.0.0)
|
43
70
|
foreigner-matcher!
|
44
71
|
kramdown (~> 0.13.2)
|
45
|
-
mysql (~> 2.8.1)
|
46
72
|
mysql2 (~> 0.2.7)
|
73
|
+
railties (~> 3.0.0)
|
47
74
|
rspec (~> 2.6.0)
|
data/README.md
CHANGED
@@ -2,15 +2,31 @@
|
|
2
2
|
|
3
3
|
RSpec matcher for the [Foreigner gem](https://github.com/matthuhiggins/foreigner), inspired by [Remarkable](https://github.com/remarkable/remarkable) ActiveRecord matchers.
|
4
4
|
|
5
|
+
## Version Information
|
6
|
+
|
7
|
+
Note that the matcher is exactly the same between ~> 0.1 and ~> 0.2; all that changes is the Foreigner dependency. Why, you ask? Foreigner >= 1.0.0 is Rails 3 only!
|
8
|
+
|
9
|
+
**Rails 3**
|
10
|
+
|
11
|
+
Foreigner >= 1.0.0 use foreigner-matcher ~> 0.2
|
12
|
+
|
13
|
+
Foreigner ~> 0.9 use foreigner-matcher ~> 0.1
|
14
|
+
|
15
|
+
**Rails 2.3**
|
16
|
+
|
17
|
+
Use foreigner-matcher ~> 0.1
|
18
|
+
|
5
19
|
## Installation
|
6
20
|
|
21
|
+
*Please check the Version Information for the appropriate version!*
|
22
|
+
|
7
23
|
For installation with bundler, add the following to the approrpriate group in your Gemfile:
|
8
24
|
|
9
|
-
gem "foreigner-matcher", :require => nil
|
25
|
+
gem "foreigner-matcher", "~> 0.2", :require => nil
|
10
26
|
|
11
27
|
For installation without bundler in Rails 2.3, add the following to your config/environments/test.rb:
|
12
28
|
|
13
|
-
config.gem "foreigner-matcher", :require => nil
|
29
|
+
config.gem "foreigner-matcher", "~> 0.1.1", :require => nil
|
14
30
|
|
15
31
|
To install the gem the old fashioned way:
|
16
32
|
|
@@ -54,10 +70,10 @@ These examples will also work passing <tt>:user</tt> as the table name. Why? The
|
|
54
70
|
|
55
71
|
## My Testing Environment
|
56
72
|
|
57
|
-
Specs have been run with [Ruby 1.9.
|
73
|
+
Specs have been run with [Ruby 1.9.2p290](http://www.ruby-lang.org/), [Ruby Enterprise Edition 2011.03](http://www.rubyenterpriseedition.com/), and [Rubinius](http://rubini.us/) with the following combinations:
|
58
74
|
|
59
|
-
* ActiveRecord ~> 3.0.0, Rspec ~> 2.6.0
|
60
|
-
* ActiveRecord ~> 2.3.11, Rsepc ~> 1.3.2
|
75
|
+
* ActiveRecord ~> 3.0.0, Rspec ~> 2.6.0, Foreigner >= 1.0.0
|
76
|
+
* ActiveRecord ~> 2.3.11, Rsepc ~> 1.3.2, Foreigner ~> 0.9.1
|
61
77
|
|
62
78
|
## Copyright
|
63
79
|
|
data/Rakefile
CHANGED
@@ -7,6 +7,7 @@ namespace :db do
|
|
7
7
|
task :reset do
|
8
8
|
require 'yaml'
|
9
9
|
require 'active_record'
|
10
|
+
require 'rails/railtie'
|
10
11
|
|
11
12
|
def print_table_creation(new_table)
|
12
13
|
print "\tCreating #{new_table}..."
|
@@ -54,6 +55,9 @@ namespace :db do
|
|
54
55
|
end
|
55
56
|
|
56
57
|
require 'foreigner'
|
58
|
+
foreigner_railtie = Foreigner::Railtie.new
|
59
|
+
foreigner_railtie.run_initializers(foreigner_railtie)
|
60
|
+
|
57
61
|
puts "\nCreating foreign keys"
|
58
62
|
print_foreign_key_creation('user_logins') { conn.add_foreign_key(:user_logins, :users, :dependent => :nullify) }
|
59
63
|
print_foreign_key_creation('user_types') { conn.add_foreign_key(:user_types, :users, :dependent => :restrict) }
|
data/foreigner-matcher.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Rspec matcher for testing the presence of foreign keys generated by Foreigner}
|
13
13
|
s.description = %q{Adds rspec matcher to verify the presence of foreign keys generated by Foreigner in a table schema}
|
14
14
|
|
15
|
-
s.add_dependency "foreigner", "
|
15
|
+
s.add_dependency "foreigner", ">= 1.0.0"
|
16
16
|
|
17
17
|
s.rubyforge_project = "foreigner-matcher"
|
18
18
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'active_record'
|
3
3
|
require 'foreigner-matcher'
|
4
|
+
require 'rails/railtie'
|
5
|
+
require 'foreigner'
|
4
6
|
|
5
7
|
# Open a database connection
|
6
8
|
db_config = YAML::load(File.open("#{File.dirname(__FILE__)}/config/database.yml"))
|
7
9
|
ActiveRecord::Base.establish_connection(db_config)
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
+
foreigner_railtie = Foreigner::Railtie.new
|
12
|
+
foreigner_railtie.run_initializers(foreigner_railtie)
|
11
13
|
|
12
14
|
# Requires supporting files with custom matchers and macros, etc,
|
13
15
|
# in ./support/ and its subdirectories.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreigner-matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,20 +9,19 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
13
|
-
default_executable:
|
12
|
+
date: 2011-08-29 00:00:00.000000000Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: foreigner
|
17
|
-
requirement: &
|
16
|
+
requirement: &24508860 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - ! '>='
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
21
|
+
version: 1.0.0
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *24508860
|
26
25
|
description: Adds rspec matcher to verify the presence of foreign keys generated by
|
27
26
|
Foreigner in a table schema
|
28
27
|
email:
|
@@ -50,7 +49,6 @@ files:
|
|
50
49
|
- spec/test_models/table_without_foreign_key_spec.rb
|
51
50
|
- spec/test_models/user_login_spec.rb
|
52
51
|
- spec/test_models/user_type_spec.rb
|
53
|
-
has_rdoc: true
|
54
52
|
homepage: https://github.com/yellow5/foreigner-matcher
|
55
53
|
licenses: []
|
56
54
|
post_install_message:
|
@@ -71,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
69
|
version: '0'
|
72
70
|
requirements: []
|
73
71
|
rubyforge_project: foreigner-matcher
|
74
|
-
rubygems_version: 1.6
|
72
|
+
rubygems_version: 1.8.6
|
75
73
|
signing_key:
|
76
74
|
specification_version: 3
|
77
75
|
summary: Rspec matcher for testing the presence of foreign keys generated by Foreigner
|