artisan-repository 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/artisan/repository.rb
CHANGED
@@ -7,6 +7,14 @@ module Artisan
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
class RecordNotValid < RuntimeError
|
11
|
+
attr_reader :record
|
12
|
+
|
13
|
+
def initialize(record)
|
14
|
+
@record = record
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
class Repository
|
11
19
|
def self.register_repo(repo)
|
12
20
|
@repo = repo
|
@@ -35,7 +43,7 @@ module Artisan
|
|
35
43
|
def self.project_configuration
|
36
44
|
repo.project_configuration
|
37
45
|
end
|
38
|
-
|
46
|
+
|
39
47
|
def self.change
|
40
48
|
repo.change
|
41
49
|
end
|
@@ -16,7 +16,7 @@ shared_examples "future user repository" do
|
|
16
16
|
|
17
17
|
it "raises an exception if the email is not unique" do
|
18
18
|
repo.create(attributes)
|
19
|
-
lambda { future_user = repo.create(attributes) }.should raise_exception
|
19
|
+
lambda { future_user = repo.create(attributes) }.should raise_exception(Artisan::RecordNotValid)
|
20
20
|
end
|
21
21
|
|
22
22
|
it "finds a future user account by email" do
|
@@ -35,6 +35,6 @@ shared_examples "future user repository" do
|
|
35
35
|
future_user = repo.create(:email => "person@test.com")
|
36
36
|
repo.find(future_user.id).should_not be_nil
|
37
37
|
repo.delete(future_user.id)
|
38
|
-
lambda { repo.find(future_user.id).should }.should raise_exception
|
38
|
+
lambda { repo.find(future_user.id).should }.should raise_exception(Artisan::RecordNotFound)
|
39
39
|
end
|
40
40
|
end
|
@@ -33,7 +33,7 @@ shared_examples "user repository" do
|
|
33
33
|
|
34
34
|
it "validates unique login" do
|
35
35
|
user = repo.create(:email => "test1@example.com", :login => "login", :password => "pass", :password_confirmation => "pass", :full_name => "some name")
|
36
|
-
lambda { repeat = repo.create(:email => "test2@example.com", :login => "login", :password => "pass", :password_confirmation => "pass", :full_name => "some name") }.should raise_exception
|
36
|
+
lambda { repeat = repo.create(:email => "test2@example.com", :login => "login", :password => "pass", :password_confirmation => "pass", :full_name => "some name") }.should raise_exception(Artisan::RecordNotValid)
|
37
37
|
end
|
38
38
|
|
39
39
|
it "updates the password" do
|
@@ -44,7 +44,7 @@ shared_examples "user repository" do
|
|
44
44
|
|
45
45
|
it "validates unique login...case sensitive style" do
|
46
46
|
user = repo.create(:email => "test1@example.com", :login => "login", :password => "pass", :password_confirmation => "pass", :full_name => "some name")
|
47
|
-
lambda { repeat = repo.create(:email => "test2@example.com", :login => "Login", :password => "pass", :password_confirmation => "pass", :full_name => "some name") }.should raise_exception
|
47
|
+
lambda { repeat = repo.create(:email => "test2@example.com", :login => "Login", :password => "pass", :password_confirmation => "pass", :full_name => "some name") }.should raise_exception(Artisan::RecordNotValid)
|
48
48
|
end
|
49
49
|
|
50
50
|
it "gets the user's stories" do
|
metadata
CHANGED
@@ -1,27 +1,22 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: artisan-repository
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- 8th Light Craftsmen
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-10-10 00:00:00 Z
|
12
|
+
date: 2012-10-13 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
14
|
description: An interface to the Artisan persistance layer
|
17
15
|
email: paul@8thlight.com
|
18
16
|
executables: []
|
19
|
-
|
20
17
|
extensions: []
|
21
|
-
|
22
18
|
extra_rdoc_files: []
|
23
|
-
|
24
|
-
files:
|
19
|
+
files:
|
25
20
|
- lib/artisan/repository.rb
|
26
21
|
- lib/artisan/shared_examples/change_examples.rb
|
27
22
|
- lib/artisan/shared_examples/future_user_examples.rb
|
@@ -31,33 +26,26 @@ files:
|
|
31
26
|
- lib/artisan/shared_examples/user_examples.rb
|
32
27
|
homepage: http://8thlight.com
|
33
28
|
licenses: []
|
34
|
-
|
35
29
|
post_install_message:
|
36
30
|
rdoc_options: []
|
37
|
-
|
38
|
-
require_paths:
|
31
|
+
require_paths:
|
39
32
|
- lib
|
40
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
34
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
- 0
|
48
|
-
version: "0"
|
49
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
40
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version:
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
55
45
|
requirements: []
|
56
|
-
|
57
46
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.8.
|
47
|
+
rubygems_version: 1.8.21
|
59
48
|
signing_key:
|
60
49
|
specification_version: 3
|
61
|
-
summary: Artisan
|
50
|
+
summary: Artisan RepositorySpec
|
62
51
|
test_files: []
|
63
|
-
|