characterizable 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -12,7 +12,6 @@ begin
12
12
  gem.authors = ["Andy Rossmeissl", "Seamus Abshere"]
13
13
  gem.add_dependency 'blockenspiel', '>=0.3.2'
14
14
  gem.add_dependency 'activesupport', '>=2.3.5'
15
- gem.add_development_dependency 'activerecord', '>=2.3.5'
16
15
  gem.add_development_dependency "shoulda", ">= 0"
17
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -113,7 +113,7 @@ module Characterizable
113
113
 
114
114
  module ClassMethods
115
115
  def characterize(&block)
116
- self.characterizable_base = Characterizable::Base.new self
116
+ self.characterizable_base ||= Characterizable::Base.new self
117
117
  Blockenspiel.invoke block, characterizable_base
118
118
  end
119
119
  delegate :characteristics, :to => :characterizable_base
@@ -105,6 +105,12 @@ class TestCharacterizable < Test::Unit::TestCase
105
105
  assert_same_contents [], a.characteristics.potential.keys
106
106
  end
107
107
 
108
+ should "know what's next" do
109
+ a = Automobile.new
110
+ a.make = 'Ford'
111
+ assert_equal true, a.characteristics.potential.keys.include?(:model_year)
112
+ end
113
+
108
114
  should "know what characteristics are wasted and why" do
109
115
  a = Automobile.new
110
116
  a.hybridity = 'Electric'
@@ -298,4 +304,17 @@ class TestCharacterizable < Test::Unit::TestCase
298
304
  a.make = nil
299
305
  assert_same_contents [:size_class, :hybridity], a.characteristics.effective.keys
300
306
  end
307
+
308
+ should "allow characterizations to be amended" do
309
+ class Fickle
310
+ include Characterizable
311
+ characterize do
312
+ has :foo
313
+ end
314
+ characterize do
315
+ has :bar
316
+ end
317
+ end
318
+ assert_equal [:bar, :foo], Fickle.characteristics.keys.sort { |a, b| a.to_s <=> b.to_s }
319
+ end
301
320
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 7
9
- version: 0.0.7
8
+ - 8
9
+ version: 0.0.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-27 00:00:00 -04:00
18
+ date: 2010-07-06 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -46,24 +46,10 @@ dependencies:
46
46
  version: 2.3.5
47
47
  type: :runtime
48
48
  version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: activerecord
51
- prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- segments:
57
- - 2
58
- - 3
59
- - 5
60
- version: 2.3.5
61
- type: :development
62
- version_requirements: *id003
63
49
  - !ruby/object:Gem::Dependency
64
50
  name: shoulda
65
51
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
52
+ requirement: &id003 !ruby/object:Gem::Requirement
67
53
  requirements:
68
54
  - - ">="
69
55
  - !ruby/object:Gem::Version
@@ -71,7 +57,7 @@ dependencies:
71
57
  - 0
72
58
  version: "0"
73
59
  type: :development
74
- version_requirements: *id004
60
+ version_requirements: *id003
75
61
  description: Characterize the relationship between "attributes" (getters/setters) of instances of a class
76
62
  email: seamus@abshere.net
77
63
  executables: []