gosu_extensions 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.12
1
+ 0.1.13
@@ -4,9 +4,8 @@ class Module
4
4
  metaclass.send :define_method, :manual! do
5
5
  puts <<-MANUAL
6
6
  MANUAL FOR #{self}
7
- #{text}
7
+ #{text}
8
8
  Change #{self}.manual! -> #{self}, to not show the manual anymore.
9
-
10
9
  MANUAL
11
10
  self
12
11
  end
data/lib/units/thing.rb CHANGED
@@ -6,7 +6,7 @@ class Thing
6
6
 
7
7
  # TODO Move these.
8
8
  #
9
- # it_is Imageable
9
+ it_is Imageable
10
10
  it_is Moveable
11
11
 
12
12
  attr_writer :layer
@@ -0,0 +1,40 @@
1
+ require File.join(File.dirname(__FILE__), '/../../spec_helper')
2
+
3
+ describe Module do
4
+
5
+ before(:each) do
6
+ @module = Module.new do
7
+ def self.to_s
8
+ "Bla" # module name in output
9
+ end
10
+ end
11
+ end
12
+
13
+ describe "manual" do
14
+ it "should define the method" do
15
+ lambda { @module.manual("some text") }.should_not raise_error
16
+ end
17
+ it "should not have a manual! method if the manual method is not called" do
18
+ lambda { @module.manual! }.should raise_error(NoMethodError)
19
+ end
20
+ end
21
+ describe "manual!" do
22
+ it "should define such a method" do
23
+ @module.stub! :puts => :we_are_not_interested_in_this
24
+ @module.manual "some text"
25
+
26
+ lambda { @module.manual! }.should_not raise_error
27
+ end
28
+ it "should define such a method which puts a given text, formatted" do
29
+ @module.should_receive(:puts).once.with <<-EXPECTED
30
+ MANUAL FOR Bla
31
+ some text
32
+ Change Bla.manual! -> Bla, to not show the manual anymore.
33
+ EXPECTED
34
+
35
+ @module.manual "some text"
36
+ @module.manual!
37
+ end
38
+ end
39
+
40
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 12
9
- version: 0.1.12
8
+ - 13
9
+ version: 0.1.13
10
10
  platform: ruby
11
11
  authors:
12
12
  - Florian Hanke
@@ -114,6 +114,7 @@ signing_key:
114
114
  specification_version: 3
115
115
  summary: Default extensions built onto the popular Gosu Framework. Uses Chipmunk for game physics. That's it for now. I'm working on them. Anyway, GAME ON!
116
116
  test_files:
117
+ - spec/lib/extensions/module_spec.rb
117
118
  - spec/lib/extensions/numeric_spec.rb
118
119
  - spec/lib/traits/attachable_spec.rb
119
120
  - spec/lib/traits/damaging_spec.rb