gosu_extensions 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.13
1
+ 0.1.14
@@ -0,0 +1,53 @@
1
+ require File.join(File.dirname(__FILE__), '/../../spec_helper')
2
+
3
+ describe InitializerHooks do
4
+
5
+ before(:each) do
6
+ @class = Class.new do
7
+ include InitializerHooks
8
+ def initialize
9
+ after_initialize
10
+ end
11
+ def to_s
12
+ "TestClass"
13
+ end
14
+ end
15
+ end
16
+
17
+ describe "register" do
18
+ it "should instance eval the given hook on initializing" do
19
+ InitializerHooks.register @class do
20
+ raise "Hook called in #{self}"
21
+ end
22
+
23
+ lambda { @class.new }.should raise_error("Hook called in TestClass")
24
+ end
25
+ end
26
+
27
+ describe "append" do
28
+ it "should instance eval the given hook on initializing" do
29
+ InitializerHooks.register @class do
30
+ raise "Hook called in #{self}"
31
+ end
32
+ InitializerHooks.append @class do
33
+ raise "Appended hook called in #{self}"
34
+ end
35
+
36
+ lambda { @class.new }.should raise_error("Hook called in TestClass")
37
+ end
38
+ end
39
+
40
+ describe "prepend" do
41
+ it "should instance eval the given hook on initializing" do
42
+ InitializerHooks.register @class do
43
+ raise "Hook called in #{self}"
44
+ end
45
+ InitializerHooks.prepend @class do
46
+ raise "Prepended hook called in #{self}"
47
+ end
48
+
49
+ lambda { @class.new }.should raise_error("Prepended hook called in TestClass")
50
+ end
51
+ end
52
+
53
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 13
9
- version: 0.1.13
8
+ - 14
9
+ version: 0.1.14
10
10
  platform: ruby
11
11
  authors:
12
12
  - Florian Hanke
@@ -119,6 +119,7 @@ test_files:
119
119
  - spec/lib/traits/attachable_spec.rb
120
120
  - spec/lib/traits/damaging_spec.rb
121
121
  - spec/lib/traits/imageable_spec.rb
122
+ - spec/lib/traits/initializer_hooks_spec.rb
122
123
  - spec/lib/traits/shooter_spec.rb
123
124
  - spec/lib/traits/short_lived_spec.rb
124
125
  - spec/lib/traits/shot_spec.rb