doodle 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/spec/init_spec.rb CHANGED
@@ -17,22 +17,22 @@ describe Doodle, 'init' do
17
17
  end
18
18
  end
19
19
  it 'should have instance attribute init via class' do
20
- Foo.attributes[:moniker].init.should == 'D1'
20
+ Foo.doodle_attributes[:moniker].init.should == 'D1'
21
21
  end
22
22
  it 'should have instance attribute init via instance' do
23
- @foo.attributes[:moniker].init.should == 'D1'
23
+ @foo.doodle_attributes[:moniker].init.should == 'D1'
24
24
  end
25
25
  it 'should have class attribute init via class.singleton_class' do
26
- Foo.singleton_class.attributes(false)[:metadata].init.should == 'D2'
26
+ Foo.singleton_class.doodle_attributes(false)[:metadata].init.should == 'D2'
27
27
  end
28
28
  it 'should have class attribute init via class.singleton_class' do
29
- Foo.singleton_class.attributes[:metadata].init.should == 'D2'
29
+ Foo.singleton_class.doodle_attributes[:metadata].init.should == 'D2'
30
30
  end
31
31
  it 'should have singleton attribute init via instance.singleton_class' do
32
- @foo.singleton_class.attributes(false)[:special].init.should == 'D3'
32
+ @foo.singleton_class.doodle_attributes(false)[:special].init.should == 'D3'
33
33
  end
34
34
  it 'should have singleton attribute init via instance.singleton_class' do
35
- @foo.singleton_class.attributes[:special].init.should == 'D3'
35
+ @foo.singleton_class.doodle_attributes[:special].init.should == 'D3'
36
36
  end
37
37
  it 'should have an attribute :moniker from init' do
38
38
  @foo.moniker.should == 'D1'
@@ -8,9 +8,9 @@ describe Doodle, "singletons" do
8
8
  has :c1
9
9
  end
10
10
  end
11
- Foo.attributes.should_be OrderedHash.new
12
- Foo.singleton_class.attributes.should_not_be OrderedHash.new
13
- Foo.singleton_class.attributes.map{ |name, attr| name }.should_be [:c1]
11
+ Foo.doodle_attributes.should_be OrderedHash.new
12
+ Foo.singleton_class.doodle_attributes.should_not_be OrderedHash.new
13
+ Foo.singleton_class.doodle_attributes.map{ |name, attr| name }.should_be [:c1]
14
14
  Foo.c1 = 1
15
15
  Foo.c1.should_be 1
16
16
  end
@@ -22,9 +22,9 @@ describe Doodle, "singletons" do
22
22
  has :c2
23
23
  end
24
24
  end
25
- Foo.attributes.should_be OrderedHash.new
26
- Foo.singleton_class.attributes.should_not_be OrderedHash.new
27
- Foo.singleton_class.attributes.map{ |name, attr| name }.should_be [:c2]
25
+ Foo.doodle_attributes.should_be OrderedHash.new
26
+ Foo.singleton_class.doodle_attributes.should_not_be OrderedHash.new
27
+ Foo.singleton_class.doodle_attributes.map{ |name, attr| name }.should_be [:c2]
28
28
  Foo.c2 = 1
29
29
  Foo.c2.should_be 1
30
30
  end
@@ -36,9 +36,9 @@ describe Doodle, "singletons" do
36
36
  class << foo
37
37
  has :i1
38
38
  end
39
- foo.attributes.keys.should_be [:i1]
40
- foo.singleton_class.attributes.should_not_be OrderedHash.new
41
- foo.singleton_class.attributes.map{ |name, attr| name }.should_be [:i1]
39
+ foo.doodle_attributes.keys.should_be [:i1]
40
+ foo.singleton_class.doodle_attributes.should_not_be OrderedHash.new
41
+ foo.singleton_class.doodle_attributes.map{ |name, attr| name }.should_be [:i1]
42
42
  foo.i1 = 1
43
43
  foo.i1.should_be 1
44
44
  end
@@ -53,9 +53,9 @@ describe Doodle, "singletons" do
53
53
  has :i2
54
54
  end
55
55
  end
56
- foo.attributes.should_be OrderedHash.new
57
- foo.singleton_class.singleton_class.attributes.should_not_be OrderedHash.new
58
- foo.singleton_class.singleton_class.attributes.map{ |name, attr| name }.should_be [:i2]
56
+ foo.doodle_attributes.should_be OrderedHash.new
57
+ foo.singleton_class.singleton_class.doodle_attributes.should_not_be OrderedHash.new
58
+ foo.singleton_class.singleton_class.doodle_attributes.map{ |name, attr| name }.should_be [:i2]
59
59
  foo.singleton_class.i2 = 1
60
60
  foo.singleton_class.i2.should_be 1
61
61
  end
@@ -5,7 +5,7 @@ require 'doodle/datatypes'
5
5
  describe 'Doodle', 'specialized attributes' do
6
6
  temporary_constant :Foo, :SpecializedAttribute do
7
7
  before :each do
8
- class SpecializedAttribute < Doodle::Attribute
8
+ class SpecializedAttribute < Doodle::DoodleAttribute
9
9
  end
10
10
 
11
11
  class Foo < Doodle
@@ -55,9 +55,9 @@ describe 'Doodle', 'specialized attributes' do
55
55
  rv.class.should_be SpecializedAttribute
56
56
  rv.flag.should_be 'sflag'
57
57
  end
58
- Foo.attributes[:ivar1].flag.should_be "sflag"
58
+ Foo.doodle_attributes[:ivar1].flag.should_be "sflag"
59
59
  foo = Foo.new('hi')
60
- foo.attributes[:ivar1].flag.should_be "sflag"
60
+ foo.doodle_attributes[:ivar1].flag.should_be "sflag"
61
61
  end
62
62
 
63
63
  it 'should allow using datatypes in additional directives invoking specialized attribute of correct class' do
@@ -79,9 +79,9 @@ describe 'Doodle', 'specialized attributes' do
79
79
  rv.class.should_be SpecializedAttribute
80
80
  rv.flag.should_be 'x'
81
81
  end
82
- Foo.attributes[:ivar1].flag.should_be "x"
82
+ Foo.doodle_attributes[:ivar1].flag.should_be "x"
83
83
  foo = Foo.new('hi')
84
- foo.attributes[:ivar1].flag.should_be "x"
84
+ foo.doodle_attributes[:ivar1].flag.should_be "x"
85
85
  end
86
86
 
87
87
  it 'should allow using datatypes in additional directives invoking specialized attribute of correct class and raise error if incorrect value supplied' do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper.rb'
2
2
 
3
- describe 'Doodle', 'parents' do
3
+ describe 'Doodle', 'doodle_parents' do
4
4
  temporary_constant :Foo do
5
5
  before :each do
6
6
  class Foo < Doodle
@@ -12,13 +12,13 @@ describe 'Doodle', 'parents' do
12
12
  @sclass_foo = class << @foo; class << self; self; end; end
13
13
  end
14
14
 
15
- it 'should have no singleton parents ' do
16
- @sc.parents.should == []
15
+ it 'should have no singleton doodle_parents ' do
16
+ @sc.doodle_parents.should == []
17
17
  end
18
18
 
19
- # it "should have singleton class's singleton class parents == []" do
20
- # expected_parents = RUBY_VERSION <= "1.8.6" ? [] : [Module, Object, BasicObject]
21
- # @scc.parents.should == expected_parents
19
+ # it "should have singleton class's singleton class doodle_parents == []" do
20
+ # expected_doodle_parents = RUBY_VERSION <= "1.8.6" ? [] : [Module, Object, BasicObject]
21
+ # @scc.doodle_parents.should == expected_doodle_parents
22
22
  # end
23
23
  end
24
24
  end
@@ -58,19 +58,19 @@ describe :DateRange, 'validation & conversions' do
58
58
 
59
59
  it 'should have start_date kind == Date' do
60
60
  d = DateRange.new
61
- d.attributes[:start_date].kind == Date
61
+ d.doodle_attributes[:start_date].kind == Date
62
62
  end
63
63
 
64
64
  it 'should have two validations' do
65
65
  d = DateRange.new
66
- d.attributes[:start_date].validations.size.should_be 2
67
- d.attributes[:start_date].validations(false).size.should_be 2
66
+ d.doodle_attributes[:start_date].doodle_validations.size.should_be 2
67
+ d.doodle_attributes[:start_date].doodle_validations(false).size.should_be 2
68
68
  end
69
69
 
70
70
  it 'should have two conversions' do
71
71
  d = DateRange.new
72
- d.attributes[:start_date].conversions.size.should_be 3
73
- d.attributes[:start_date].conversions(false).size.should_be 3
72
+ d.doodle_attributes[:start_date].doodle_conversions.size.should_be 3
73
+ d.doodle_attributes[:start_date].doodle_conversions(false).size.should_be 3
74
74
  end
75
75
 
76
76
  it 'should convert from Array' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doodle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean O'Halpin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-06 00:00:00 +01:00
12
+ date: 2008-05-08 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15