dm-types 1.0.0.rc2 → 1.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -71,7 +71,7 @@
71
71
  source 'http://rubygems.org'
72
72
 
73
73
  DATAMAPPER = 'git://github.com/datamapper'
74
- DM_VERSION = '~> 1.0.0.rc2'
74
+ DM_VERSION = '~> 1.0.0.rc3'
75
75
 
76
76
  group :runtime do # Runtime dependencies (as in the gemspec)
77
77
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009, 2008, 2009 Sam Smoot, Dan Kubb
1
+ Copyright (c) 2008, 2009, 2010 Sam Smoot, Dan Kubb
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -10,19 +10,19 @@ begin
10
10
  gem.summary = 'DataMapper plugin providing extra data types'
11
11
  gem.description = gem.summary
12
12
  gem.email = 'dan.kubb [a] gmail [d] com'
13
- gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/%s' % gem.name
13
+ gem.homepage = 'http://github.com/datamapper/%s' % gem.name
14
14
  gem.authors = [ 'Dan Kubb' ]
15
15
 
16
16
  gem.rubyforge_project = 'datamapper'
17
17
 
18
- gem.add_dependency 'dm-core', '~> 1.0.0.rc2'
19
- gem.add_dependency 'fastercsv', '~> 1.5.3'
20
- gem.add_dependency 'json_pure', '~> 1.4.3'
21
- gem.add_dependency 'uuidtools', '~> 2.1.1'
22
- gem.add_dependency 'stringex', '~> 1.1.0'
18
+ gem.add_dependency 'dm-core', '~> 1.0.0.rc3'
19
+ gem.add_dependency 'fastercsv', '~> 1.5.3'
20
+ gem.add_dependency 'json_pure', '~> 1.4.3'
21
+ gem.add_dependency 'uuidtools', '~> 2.1.1'
22
+ gem.add_dependency 'stringex', '~> 1.1.0'
23
23
 
24
- gem.add_development_dependency 'rspec', '~> 1.3'
25
- gem.add_development_dependency 'dm-validations', '~> 1.0.0.rc2'
24
+ gem.add_development_dependency 'rspec', '~> 1.3'
25
+ gem.add_development_dependency 'dm-validations', '~> 1.0.0.rc3'
26
26
  end
27
27
 
28
28
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.rc2
1
+ 1.0.0.rc3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dm-types}
8
- s.version = "1.0.0.rc2"
8
+ s.version = "1.0.0.rc3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Kubb"]
12
- s.date = %q{2010-05-19}
12
+ s.date = %q{2010-05-27}
13
13
  s.description = %q{DataMapper plugin providing extra data types}
14
14
  s.email = %q{dan.kubb [a] gmail [d] com}
15
15
  s.extra_rdoc_files = [
@@ -85,7 +85,7 @@ Gem::Specification.new do |s|
85
85
  "tasks/yard.rake",
86
86
  "tasks/yardstick.rake"
87
87
  ]
88
- s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/dm-types}
88
+ s.homepage = %q{http://github.com/datamapper/dm-types}
89
89
  s.rdoc_options = ["--charset=UTF-8"]
90
90
  s.require_paths = ["lib"]
91
91
  s.rubyforge_project = %q{datamapper}
@@ -133,30 +133,30 @@ Gem::Specification.new do |s|
133
133
  s.specification_version = 3
134
134
 
135
135
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
136
- s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.0.rc2"])
136
+ s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.0.rc3"])
137
137
  s.add_runtime_dependency(%q<fastercsv>, ["~> 1.5.3"])
138
138
  s.add_runtime_dependency(%q<json_pure>, ["~> 1.4.3"])
139
139
  s.add_runtime_dependency(%q<uuidtools>, ["~> 2.1.1"])
140
140
  s.add_runtime_dependency(%q<stringex>, ["~> 1.1.0"])
141
141
  s.add_development_dependency(%q<rspec>, ["~> 1.3"])
142
- s.add_development_dependency(%q<dm-validations>, ["~> 1.0.0.rc2"])
142
+ s.add_development_dependency(%q<dm-validations>, ["~> 1.0.0.rc3"])
143
143
  else
144
- s.add_dependency(%q<dm-core>, ["~> 1.0.0.rc2"])
144
+ s.add_dependency(%q<dm-core>, ["~> 1.0.0.rc3"])
145
145
  s.add_dependency(%q<fastercsv>, ["~> 1.5.3"])
146
146
  s.add_dependency(%q<json_pure>, ["~> 1.4.3"])
147
147
  s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
148
148
  s.add_dependency(%q<stringex>, ["~> 1.1.0"])
149
149
  s.add_dependency(%q<rspec>, ["~> 1.3"])
150
- s.add_dependency(%q<dm-validations>, ["~> 1.0.0.rc2"])
150
+ s.add_dependency(%q<dm-validations>, ["~> 1.0.0.rc3"])
151
151
  end
152
152
  else
153
- s.add_dependency(%q<dm-core>, ["~> 1.0.0.rc2"])
153
+ s.add_dependency(%q<dm-core>, ["~> 1.0.0.rc3"])
154
154
  s.add_dependency(%q<fastercsv>, ["~> 1.5.3"])
155
155
  s.add_dependency(%q<json_pure>, ["~> 1.4.3"])
156
156
  s.add_dependency(%q<uuidtools>, ["~> 2.1.1"])
157
157
  s.add_dependency(%q<stringex>, ["~> 1.1.0"])
158
158
  s.add_dependency(%q<rspec>, ["~> 1.3"])
159
- s.add_dependency(%q<dm-validations>, ["~> 1.0.0.rc2"])
159
+ s.add_dependency(%q<dm-validations>, ["~> 1.0.0.rc3"])
160
160
  end
161
161
  end
162
162
 
@@ -32,3 +32,8 @@ module DataMapper
32
32
  end # class BCryptHash
33
33
  end # class Property
34
34
  end # module DataMapper
35
+
36
+ # The Bcrypt::Password#hash method returns a String and not an Integer,
37
+ # which is required by any ruby class that uses a Hash underneath. Removing
38
+ # this method does not cause any spec failures in Bcrypt::Password
39
+ BCrypt::Password.class_eval { remove_method :hash }
@@ -7,12 +7,18 @@ module DataMapper
7
7
 
8
8
  attr_reader :flag_map
9
9
 
10
+ def self.[](*values)
11
+ klass = ::Class.new(self)
12
+ klass.flags(values)
13
+ klass
14
+ end
15
+
10
16
  def initialize(model, name, options = {}, type = nil)
11
17
  super
12
18
 
13
19
  @flag_map = {}
14
20
 
15
- flags = options.fetch(:flags)
21
+ flags = options.fetch(:flags, self.class.flags)
16
22
  flags.each_with_index do |flag, i|
17
23
  @flag_map[i + 1] = flag
18
24
  end
@@ -1,5 +1,12 @@
1
1
  require 'dm-core'
2
2
 
3
+ begin
4
+ # provide Time#utc_time for DateTime#to_time in AS
5
+ require 'active_support/core_ext/time/calculations'
6
+ rescue LoadError
7
+ # do nothing, extlib is being used and does not require this method
8
+ end
9
+
3
10
  module DataMapper
4
11
  class Property
5
12
  class EpochTime < Integer
@@ -14,7 +21,7 @@ module DataMapper
14
21
  def dump(value)
15
22
  case value
16
23
  when ::Integer, ::Time then value.to_i
17
- when ::DateTime then value.to_time.to_i
24
+ when ::DateTime then value.to_time.to_i
18
25
  end
19
26
  end
20
27
  end # class EpochTime
@@ -10,6 +10,10 @@ module DataMapper
10
10
  value.kind_of?(Pathname)
11
11
  end
12
12
 
13
+ def valid?(value, negated = false)
14
+ super || dump(value).kind_of?(::String)
15
+ end
16
+
13
17
  def load(value)
14
18
  if value.blank?
15
19
  nil
@@ -7,12 +7,18 @@ module DataMapper
7
7
 
8
8
  attr_reader :flag_map
9
9
 
10
+ def self.[](*values)
11
+ klass = ::Class.new(self)
12
+ klass.flags(values)
13
+ klass
14
+ end
15
+
10
16
  def initialize(model, name, options = {}, type = nil)
11
17
  super
12
18
 
13
19
  @flag_map = {}
14
20
 
15
- flags = options.fetch(:flags)
21
+ flags = options.fetch(:flags, self.class.flags)
16
22
  flags.each_with_index do |flag, i|
17
23
  flag_map[i] = flag
18
24
  end
@@ -10,6 +10,10 @@ module DataMapper
10
10
  value.kind_of?(IPAddr)
11
11
  end
12
12
 
13
+ def valid?(value, negated = false)
14
+ super || dump(value).kind_of?(::String)
15
+ end
16
+
13
17
  def load(value)
14
18
  if value.nil?
15
19
  nil
@@ -12,6 +12,10 @@ module DataMapper
12
12
  value.kind_of?(::Array) || value.kind_of?(::Hash)
13
13
  end
14
14
 
15
+ def valid?(value, negated = false)
16
+ super || dump(value).kind_of?(::String)
17
+ end
18
+
15
19
  def load(value)
16
20
  if value.nil?
17
21
  nil
@@ -9,7 +9,7 @@ module DataMapper
9
9
  # not exceed the maximum URI length either.
10
10
  length 2000
11
11
 
12
- def dump(value)
12
+ def typecast(value)
13
13
  return if value.nil?
14
14
 
15
15
  if value.respond_to?(:to_str)
@@ -16,7 +16,7 @@ module DataMapper
16
16
  property :id, Serial
17
17
  property :title, String, :length => 255
18
18
  property :body, Text
19
- property :status, Enum, :flags => [:unconfirmed, :confirmed, :assigned, :resolved, :not_applicable]
19
+ property :status, Enum[:unconfirmed, :confirmed, :assigned, :resolved, :not_applicable]
20
20
  end # Ticket
21
21
  end
22
22
  end
@@ -16,10 +16,10 @@ module DataMapper
16
16
  property :id, Serial
17
17
  property :writing, String
18
18
  property :has_picture, Boolean, :default => false
19
- property :picture, Enum, :flags => [:octocat, :fork_you, :git_down]
19
+ property :picture, Enum[:octocat, :fork_you, :git_down]
20
20
 
21
- property :color, Enum, :flags => [:white, :black, :red, :orange, :yellow, :green, :cyan, :blue, :purple]
22
- property :size, Flag, :flags => [:xs, :small, :medium, :large, :xl, :xxl]
21
+ property :color, Enum[:white, :black, :red, :orange, :yellow, :green, :cyan, :blue, :purple]
22
+ property :size, Flag[:xs, :small, :medium, :large, :xl, :xxl]
23
23
  end # Shirt
24
24
  end # Fixtures
25
25
  end # Types
@@ -38,6 +38,10 @@ try_spec do
38
38
  it 'uses cost of BCrypt::Engine::DEFAULT_COST' do
39
39
  @resource.password.cost.should == BCrypt::Engine::DEFAULT_COST
40
40
  end
41
+
42
+ it 'allows Bcrypt::Password#hash to be an Integer' do
43
+ @resource.password.hash.should be_kind_of(Integer)
44
+ end
41
45
  end
42
46
  end
43
47
  end
@@ -17,7 +17,7 @@ try_spec do
17
17
 
18
18
  describe 'when dumped and loaded again' do
19
19
  before :all do
20
- @resource.save.should be_true
20
+ @resource.save.should be(true)
21
21
  @resource.reload
22
22
  end
23
23
 
@@ -34,7 +34,7 @@ try_spec do
34
34
 
35
35
  describe 'when dumped and loaded again' do
36
36
  before :all do
37
- @resource.save.should be_true
37
+ @resource.save.should be(true)
38
38
  @resource.reload
39
39
  end
40
40
 
@@ -61,7 +61,7 @@ try_spec do
61
61
 
62
62
  describe 'when dumped and loaded again' do
63
63
  before :all do
64
- @resource.save.should be_true
64
+ @resource.save.should be(true)
65
65
  @resource.reload
66
66
  end
67
67
 
@@ -78,7 +78,7 @@ try_spec do
78
78
  end
79
79
 
80
80
  it 'has blank entries removed' do
81
- @resource.interests.any? { |i| i.blank? }.should be_false
81
+ @resource.interests.any? { |i| i.blank? }.should be(false)
82
82
  end
83
83
 
84
84
  it 'has duplicates removed' do
@@ -15,7 +15,7 @@ try_spec do
15
15
  :status => 'confirmed'
16
16
  )
17
17
 
18
- @resource.save.should be_true
18
+ @resource.save.should be(true)
19
19
  @resource.reload
20
20
  end
21
21
 
@@ -42,7 +42,7 @@ try_spec do
42
42
  :body => "Note that at the very least, there should be a check to see whether or not the user is created before chown'ing a file to the user.",
43
43
  :status => 'confirmed'
44
44
  )
45
- @resource.save.should be_true
45
+ @resource.save.should be(true)
46
46
  end
47
47
 
48
48
  it 'supports queries with equality operator on enumeration property' do
@@ -54,7 +54,7 @@ try_spec do
54
54
 
55
55
  describe 'when saved and reloaded' do
56
56
  before :all do
57
- @resource.save.should be_true
57
+ @resource.save.should be(true)
58
58
  @resource.reload
59
59
  end
60
60
 
@@ -96,7 +96,7 @@ try_spec do
96
96
 
97
97
  describe 'when saved and reloaded' do
98
98
  before :all do
99
- @resource.save.should be_true
99
+ @resource.save.should be(true)
100
100
  @resource.reload
101
101
  end
102
102
 
@@ -114,7 +114,7 @@ try_spec do
114
114
 
115
115
  describe 'when saved and reloaded' do
116
116
  before :all do
117
- @resource.save.should be_true
117
+ @resource.save.should be(true)
118
118
  @resource.reload
119
119
  end
120
120
 
@@ -132,7 +132,7 @@ try_spec do
132
132
 
133
133
  describe 'when saved and reloaded' do
134
134
  before :all do
135
- @resource.save.should be_true
135
+ @resource.save.should be(true)
136
136
  @resource.reload
137
137
  end
138
138
 
@@ -19,7 +19,7 @@ try_spec do
19
19
  describe 'with multiple sizes' do
20
20
  describe 'dumped and loaded' do
21
21
  before do
22
- @resource.save.should be_true
22
+ @resource.save.should be(true)
23
23
  @resource.reload
24
24
  end
25
25
 
@@ -36,7 +36,7 @@ try_spec do
36
36
 
37
37
  describe 'dumped and loaded' do
38
38
  before do
39
- @resource.save.should be_true
39
+ @resource.save.should be(true)
40
40
  @resource.reload
41
41
  end
42
42
 
@@ -33,7 +33,7 @@ try_spec do
33
33
 
34
34
  describe 'when dumped and loaded' do
35
35
  before :all do
36
- @resource.save.should be_true
36
+ @resource.save.should be(true)
37
37
  @resource.reload
38
38
  end
39
39
 
@@ -50,7 +50,7 @@ try_spec do
50
50
 
51
51
  describe 'when dumped and loaded' do
52
52
  before :all do
53
- @resource.save.should be_true
53
+ @resource.save.should be(true)
54
54
  @resource.reload
55
55
  end
56
56
 
@@ -67,7 +67,7 @@ try_spec do
67
67
 
68
68
  describe 'when dumped and loaded' do
69
69
  before :all do
70
- @resource.save.should be_true
70
+ @resource.save.should be(true)
71
71
  @resource.reload
72
72
  end
73
73
 
@@ -84,7 +84,7 @@ try_spec do
84
84
 
85
85
  describe 'when dumped and loaded' do
86
86
  before :all do
87
- @resource.save.should be_true
87
+ @resource.save.should be(true)
88
88
  @resource.reload
89
89
  end
90
90
 
@@ -101,7 +101,7 @@ try_spec do
101
101
 
102
102
  describe 'when dumped and loaded' do
103
103
  before :all do
104
- @resource.save.should be_true
104
+ @resource.save.should be(true)
105
105
  @resource.reload
106
106
  end
107
107
 
@@ -122,7 +122,7 @@ try_spec do
122
122
 
123
123
  describe 'when dumped and loaded' do
124
124
  before :all do
125
- @resource.save.should be_true
125
+ @resource.save.should be(true)
126
126
  @resource.reload
127
127
  end
128
128
 
@@ -143,7 +143,7 @@ try_spec do
143
143
 
144
144
  describe 'when dumped and loaded' do
145
145
  before :all do
146
- @resource.save.should be_true
146
+ @resource.save.should be(true)
147
147
  @resource.reload
148
148
  end
149
149
 
@@ -17,7 +17,7 @@ try_spec do
17
17
 
18
18
  describe 'when dumped and loaded again' do
19
19
  before :all do
20
- @resource.save.should be_true
20
+ @resource.save.should be(true)
21
21
  @resource.reload
22
22
  end
23
23
 
@@ -37,7 +37,7 @@ try_spec do
37
37
 
38
38
  describe 'when dumped and loaded again' do
39
39
  before :all do
40
- @resource.save.should be_true
40
+ @resource.save.should be(true)
41
41
  @resource.reload
42
42
  end
43
43
 
@@ -57,7 +57,7 @@ try_spec do
57
57
 
58
58
  describe 'when dumped and loaded again' do
59
59
  before :all do
60
- @resource.save.should be_true
60
+ @resource.save.should be(true)
61
61
  @resource.reload
62
62
  end
63
63
 
@@ -36,19 +36,25 @@ try_spec do
36
36
  ["La ley antipiratería reduce un 33% el tráfico online en Suecia", 'la-ley-antipirateria-reduce-un-33-percent-el-trafico-online-en-suecia'],
37
37
  ["L'Etat américain du Texas s'apprête à interdire Windows Vista", 'letat-americain-du-texas-sapprete-a-interdire-windows-vista']
38
38
  ].each do |title, slug|
39
- describe "persisted with title '#{title}'" do
39
+ describe "set with title '#{title}'" do
40
40
  before :all do
41
41
  @resource = DataMapper::Types::Fixtures::Article.new(:title => title)
42
- @resource.save.should be_true
43
- @resource.reload
42
+ @resource.valid?.should be(true)
44
43
  end
45
44
 
46
45
  it "has slug equal to '#{slug}'" do
47
46
  @resource.slug.should == slug
48
47
  end
49
48
 
50
- it 'can be found by slug' do
51
- DataMapper::Types::Fixtures::Article.first(:slug => slug).should == @resource
49
+ describe "and persisted" do
50
+ before :all do
51
+ @resource.save.should be(true)
52
+ @resource.reload
53
+ end
54
+
55
+ it 'can be found by slug' do
56
+ DataMapper::Types::Fixtures::Article.first(:slug => slug).should == @resource
57
+ end
52
58
  end
53
59
  end
54
60
  end
@@ -16,7 +16,7 @@ try_spec do
16
16
  :tags => %w[ misc ]
17
17
  )
18
18
 
19
- @resource.save.should be_true
19
+ @resource.save.should be(true)
20
20
  end
21
21
 
22
22
  it 'can be found by uri' do
@@ -45,7 +45,7 @@ try_spec do
45
45
  :tags => %w[ misc ]
46
46
  )
47
47
 
48
- @resource.save.should be_true
48
+ @resource.save.should be(true)
49
49
  end
50
50
 
51
51
  it 'can be found by uri' do
@@ -79,7 +79,7 @@ try_spec do
79
79
  end
80
80
 
81
81
  it 'is perfectly valid (URI type does not provide auto validations)' do
82
- @resource.save.should be_true
82
+ @resource.save.should be(true)
83
83
  end
84
84
  end
85
85
 
@@ -116,7 +116,7 @@ try_spec do
116
116
  :tags => %w[ misc ]
117
117
  )
118
118
 
119
- @resource.save.should be_true
119
+ @resource.save.should be(true)
120
120
  end
121
121
 
122
122
  it 'can be found by uri' do
@@ -12,7 +12,7 @@ try_spec do
12
12
  @uuid = UUIDTools::UUID.parse(@uuid_string)
13
13
  @resource = DataMapper::Types::Fixtures::NetworkNode.new(:uuid => @uuid)
14
14
 
15
- @resource.save.should be_true
15
+ @resource.save.should be(true)
16
16
  end
17
17
 
18
18
  describe 'when reloaded' do
@@ -18,7 +18,7 @@ try_spec do
18
18
 
19
19
  describe 'when dumped and loaded again' do
20
20
  before :all do
21
- @resource.save.should be_true
21
+ @resource.save.should be(true)
22
22
  @resource.reload
23
23
  end
24
24
 
@@ -38,7 +38,7 @@ try_spec do
38
38
 
39
39
  describe 'when dumped and loaded again' do
40
40
  before :all do
41
- @resource.save.should be_true
41
+ @resource.save.should be(true)
42
42
  @resource.reload
43
43
  end
44
44
 
@@ -55,7 +55,7 @@ try_spec do
55
55
 
56
56
  describe 'when dumped and loaded again' do
57
57
  before :all do
58
- @resource.save.should be_true
58
+ @resource.save.should be(true)
59
59
  @resource.reload
60
60
  end
61
61
 
@@ -1,4 +1,4 @@
1
- --exclude "spec"
1
+ --exclude "spec,^/"
2
2
  --sort coverage
3
3
  --callsites
4
4
  --xrefs
@@ -11,7 +11,7 @@ try_spec do
11
11
 
12
12
  describe '.dump' do
13
13
  before do
14
- @enum = User.property(:enum, DataMapper::Property::Enum, :flags => [:first, :second, :third])
14
+ @enum = User.property(:enum, DataMapper::Property::Enum[:first, :second, :third])
15
15
  end
16
16
 
17
17
  it 'should return the key of the value match from the flag map' do
@@ -12,6 +12,18 @@ try_spec do
12
12
  @path = Pathname.new(@input)
13
13
  end
14
14
 
15
+ describe '#valid?' do
16
+ describe "with a String" do
17
+ subject { @property.valid?(@input) }
18
+ it { subject.should be(true) }
19
+ end
20
+
21
+ describe "with a Pathname" do
22
+ subject { @property.valid?(@path) }
23
+ it { subject.should be(true) }
24
+ end
25
+ end
26
+
15
27
  describe '.dump' do
16
28
  describe 'when input is a string' do
17
29
  it 'does not modify input' do
@@ -7,7 +7,7 @@ try_spec do
7
7
  describe '.dump' do
8
8
  before :all do
9
9
  @flag = DataMapper::Types::Fixtures::TShirt.property(
10
- :stuff, DataMapper::Property::Flag, :flags => [:first, :second, :third, :fourth, :fifth])
10
+ :stuff, DataMapper::Property::Flag[:first, :second, :third, :fourth, :fifth])
11
11
  end
12
12
 
13
13
  describe 'when argument matches a value in the flag map' do
@@ -10,6 +10,18 @@ try_spec do
10
10
  @property = DataMapper::Types::Fixtures::NetworkNode.properties[:ip_address]
11
11
  end
12
12
 
13
+ describe '#valid?' do
14
+ describe "with a String" do
15
+ subject { @property.valid?(@stored) }
16
+ it { subject.should be(true) }
17
+ end
18
+
19
+ describe "with an IPAddr" do
20
+ subject { @property.valid?(@input) }
21
+ it { subject.should be(true) }
22
+ end
23
+ end
24
+
13
25
  describe '.dump' do
14
26
  describe 'when argument is an IP address given as Ruby object' do
15
27
  before :all do
@@ -10,6 +10,23 @@ try_spec do
10
10
  @property = DataMapper::Types::Fixtures::Person.properties[:positions]
11
11
  end
12
12
 
13
+ describe '#valid?' do
14
+ before :all do
15
+ @string = '{ "foo": "bar" }'
16
+ @json = JSON.load(@string)
17
+ end
18
+
19
+ describe "with a String" do
20
+ subject { @property.valid?(@input) }
21
+ it { subject.should be(true) }
22
+ end
23
+
24
+ describe "with JSON" do
25
+ subject { @property.valid?(@json) }
26
+ it { subject.should be(true) }
27
+ end
28
+ end
29
+
13
30
  describe '.load' do
14
31
  describe 'when nil is provided' do
15
32
  it 'returns nil' do
@@ -28,7 +28,7 @@ describe DataMapper::Property::ParanoidBoolean do
28
28
  @resource = @model.new
29
29
  end
30
30
 
31
- it { should be_false }
31
+ it { should be(false) }
32
32
 
33
33
  it 'should not delete the resource from the datastore' do
34
34
  method(:subject).should_not change { @model.with_deleted.size }.from(0)
@@ -49,7 +49,7 @@ describe DataMapper::Property::ParanoidBoolean do
49
49
  @resource = @model.create
50
50
  end
51
51
 
52
- it { should be_true }
52
+ it { should be(true) }
53
53
 
54
54
  it 'should not delete the resource from the datastore' do
55
55
  method(:subject).should_not change { @model.with_deleted.size }.from(1)
@@ -74,7 +74,7 @@ describe DataMapper::Property::ParanoidBoolean do
74
74
  @resource = @model.new
75
75
  end
76
76
 
77
- it { should be_false }
77
+ it { should be(false) }
78
78
 
79
79
  it 'should not delete the resource from the datastore' do
80
80
  method(:subject).should_not change { @model.with_deleted.size }.from(0)
@@ -95,7 +95,7 @@ describe DataMapper::Property::ParanoidBoolean do
95
95
  @resource = @model.create
96
96
  end
97
97
 
98
- it { should be_true }
98
+ it { should be(true) }
99
99
 
100
100
  it 'should delete the resource from the datastore' do
101
101
  method(:subject).should change { @model.with_deleted.size }.from(1).to(0)
@@ -32,7 +32,7 @@ describe DataMapper::Property::ParanoidDateTime do
32
32
  @resource = @model.new
33
33
  end
34
34
 
35
- it { should be_false }
35
+ it { should be(false) }
36
36
 
37
37
  it 'should not delete the resource from the datastore' do
38
38
  method(:subject).should_not change { @model.with_deleted.size }.from(0)
@@ -53,7 +53,7 @@ describe DataMapper::Property::ParanoidDateTime do
53
53
  @resource = @model.create
54
54
  end
55
55
 
56
- it { should be_true }
56
+ it { should be(true) }
57
57
 
58
58
  it 'should not delete the resource from the datastore' do
59
59
  method(:subject).should_not change { @model.with_deleted.size }.from(1)
@@ -78,7 +78,7 @@ describe DataMapper::Property::ParanoidDateTime do
78
78
  @resource = @model.new
79
79
  end
80
80
 
81
- it { should be_false }
81
+ it { should be(false) }
82
82
 
83
83
  it 'should not delete the resource from the datastore' do
84
84
  method(:subject).should_not change { @model.with_deleted.size }.from(0)
@@ -99,7 +99,7 @@ describe DataMapper::Property::ParanoidDateTime do
99
99
  @resource = @model.create
100
100
  end
101
101
 
102
- it { should be_true }
102
+ it { should be(true) }
103
103
 
104
104
  it 'should delete the resource from the datastore' do
105
105
  method(:subject).should change { @model.with_deleted.size }.from(1).to(0)
@@ -35,4 +35,7 @@ rescue LoadError
35
35
  end
36
36
  end
37
37
 
38
+ task :spec => :check_dependencies
39
+ task :rcov => :check_dependencies
40
+
38
41
  task :default => :spec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-types
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940575
4
+ hash: 977940572
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
- - rc2
11
- version: 1.0.0.rc2
10
+ - rc3
11
+ version: 1.0.0.rc3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Dan Kubb
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-05-19 00:00:00 -07:00
19
+ date: 2010-05-27 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -27,13 +27,13 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 977940575
30
+ hash: 977940572
31
31
  segments:
32
32
  - 1
33
33
  - 0
34
34
  - 0
35
- - rc2
36
- version: 1.0.0.rc2
35
+ - rc3
36
+ version: 1.0.0.rc3
37
37
  type: :runtime
38
38
  version_requirements: *id001
39
39
  - !ruby/object:Gem::Dependency
@@ -123,13 +123,13 @@ dependencies:
123
123
  requirements:
124
124
  - - ~>
125
125
  - !ruby/object:Gem::Version
126
- hash: 977940575
126
+ hash: 977940572
127
127
  segments:
128
128
  - 1
129
129
  - 0
130
130
  - 0
131
- - rc2
132
- version: 1.0.0.rc2
131
+ - rc3
132
+ version: 1.0.0.rc3
133
133
  type: :development
134
134
  version_requirements: *id007
135
135
  description: DataMapper plugin providing extra data types
@@ -210,7 +210,7 @@ files:
210
210
  - tasks/yard.rake
211
211
  - tasks/yardstick.rake
212
212
  has_rdoc: true
213
- homepage: http://github.com/datamapper/dm-more/tree/master/dm-types
213
+ homepage: http://github.com/datamapper/dm-types
214
214
  licenses: []
215
215
 
216
216
  post_install_message: