canard 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Canard
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -2,10 +2,10 @@ class InitializeDb < ActiveRecord::Migration
2
2
 
3
3
  def change
4
4
  create_table :users, :force => true do |t|
5
- t.string :roles_mask
5
+ t.integer :roles_mask
6
6
  end
7
7
  create_table :user_without_roles, :force => true do |t|
8
- t.string :roles_mask
8
+ t.integer :roles_mask
9
9
  end
10
10
  create_table :user_without_role_masks, :force => true do |t|
11
11
  end
data/test/test_helper.rb CHANGED
@@ -1,17 +1,30 @@
1
1
  gem 'minitest'
2
2
  require 'minitest/autorun'
3
+ require 'active_record'
3
4
 
4
5
  # Configure Rails Environment
5
- ENV["RAILS_ENV"] = "test"
6
+ environment = ENV["RAILS_ENV"] = 'test'
7
+ rails_root = File.expand_path('../dummy', __FILE__)
8
+ database_yml = File.expand_path('config/database.yml', rails_root)
6
9
 
7
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
10
+ ActiveRecord::Base.configurations = YAML.load_file(database_yml)
11
+
12
+ config = ActiveRecord::Base.configurations[environment]
13
+ db = File.expand_path(config['database'], rails_root)
14
+
15
+ # Drop the test database and migrate up
16
+ FileUtils.rm(db) if File.exist?(db)
17
+ ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => db)
18
+ ActiveRecord::Base.connection
19
+ ActiveRecord::Migration.verbose = false
20
+ ActiveRecord::Migrator.up File.expand_path('db/migrate', rails_root)
21
+
22
+ # Load dummy rails app
23
+ require File.expand_path('config/environment.rb', rails_root)
8
24
 
9
25
  Rails.backtrace_cleaner.remove_silencers!
10
26
 
11
27
  # Load support files (reloadable reloads canard)
12
28
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
29
 
14
- ActiveRecord::Migration.verbose = false
15
- load(File.expand_path('../dummy/db/schema.rb', __FILE__))
16
-
17
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000Z
12
+ date: 2012-05-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
- requirement: &2152517180 !ruby/object:Gem::Requirement
16
+ requirement: &2152514380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2152517180
24
+ version_requirements: *2152514380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &2152516180 !ruby/object:Gem::Requirement
27
+ requirement: &2152513960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2152516180
35
+ version_requirements: *2152513960
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &2152514320 !ruby/object:Gem::Requirement
38
+ requirement: &2152510540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.2.3
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2152514320
46
+ version_requirements: *2152510540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &2152512180 !ruby/object:Gem::Requirement
49
+ requirement: &2152510080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152512180
57
+ version_requirements: *2152510080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: cancan
60
- requirement: &2152511480 !ruby/object:Gem::Requirement
60
+ requirement: &2152509620 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2152511480
68
+ version_requirements: *2152509620
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: role_model
71
- requirement: &2152510060 !ruby/object:Gem::Requirement
71
+ requirement: &2152509200 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2152510060
79
+ version_requirements: *2152509200
80
80
  description: Wraps CanCan and RoleModel up to make role based authorisation really
81
81
  easy in Rails 3.x.
82
82
  email:
@@ -135,7 +135,6 @@ files:
135
135
  - test/dummy/config/routes.rb
136
136
  - test/dummy/db/migrate/20120430083231_initialize_db.rb
137
137
  - test/dummy/db/schema.rb
138
- - test/dummy/db/test.sqlite3
139
138
  - test/dummy/log/.gitkeep
140
139
  - test/dummy/script/rails
141
140
  - test/find_abilities_test.rb
@@ -197,7 +196,6 @@ test_files:
197
196
  - test/dummy/config/routes.rb
198
197
  - test/dummy/db/migrate/20120430083231_initialize_db.rb
199
198
  - test/dummy/db/schema.rb
200
- - test/dummy/db/test.sqlite3
201
199
  - test/dummy/log/.gitkeep
202
200
  - test/dummy/script/rails
203
201
  - test/find_abilities_test.rb