dm-predefined 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +1 -1
- data/lib/dm-predefined/version.rb +1 -1
- data/spec/integration/helpers/test_model.rb +25 -0
- data/spec/integration/predefined_spec.rb +3 -28
- metadata +3 -3
- data/spec/spec.opts +0 -1
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
class TestModel
|
2
|
+
|
3
|
+
include DataMapper::Resource
|
4
|
+
include DataMapper::Predefined
|
5
|
+
|
6
|
+
# Name property to test String values
|
7
|
+
property :name, String
|
8
|
+
|
9
|
+
# Number property to test Integer values
|
10
|
+
property :number, Integer
|
11
|
+
|
12
|
+
# Optional property to test default values
|
13
|
+
property :optional, String, :default => 'hello'
|
14
|
+
|
15
|
+
# Body property to test Text values
|
16
|
+
property :body, Text
|
17
|
+
|
18
|
+
define :test1, :name => 'test1',
|
19
|
+
:number => 1,
|
20
|
+
:optional => 'yo',
|
21
|
+
:body => %{This is a test.}
|
22
|
+
|
23
|
+
define :test2, :name => 'test2', :number => 2
|
24
|
+
|
25
|
+
end
|
@@ -1,34 +1,9 @@
|
|
1
|
-
require '
|
2
|
-
require
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'integration/helpers/test_model'
|
3
3
|
|
4
4
|
if (HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES)
|
5
|
-
describe
|
5
|
+
describe DataMapper::Predefined do
|
6
6
|
before(:all) do
|
7
|
-
class TestModel
|
8
|
-
|
9
|
-
include DataMapper::Resource
|
10
|
-
include DataMapper::Predefined
|
11
|
-
|
12
|
-
# Name property to test String values
|
13
|
-
property :name, String
|
14
|
-
|
15
|
-
# Number property to test Integer values
|
16
|
-
property :number, Integer
|
17
|
-
|
18
|
-
# Optional property to test default values
|
19
|
-
property :optional, String, :default => 'hello'
|
20
|
-
|
21
|
-
# Body property to test Text values
|
22
|
-
property :body, Text
|
23
|
-
|
24
|
-
define :test1, :name => 'test1',
|
25
|
-
:number => 1,
|
26
|
-
:optional => 'yo',
|
27
|
-
:body => %{This is a test.}
|
28
|
-
|
29
|
-
define :test2, :name => 'test2', :number => 2
|
30
|
-
end
|
31
|
-
|
32
7
|
TestModel.auto_migrate!
|
33
8
|
end
|
34
9
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-predefined
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-17 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -56,8 +56,8 @@ files:
|
|
56
56
|
- lib/dm-predefined/predefined.rb
|
57
57
|
- lib/dm-predefined/version.rb
|
58
58
|
- lib/dm-predefined/exceptions/unknown_resource.rb
|
59
|
+
- spec/integration/helpers/test_model.rb
|
59
60
|
- spec/integration/predefined_spec.rb
|
60
|
-
- spec/spec.opts
|
61
61
|
- spec/spec_helper.rb
|
62
62
|
has_rdoc: true
|
63
63
|
homepage: http://dm-predefined.rubyforge.org/
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--colour
|