gosu_extensions 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/spec/lib/core/environment_spec.rb +26 -0
- data/spec/lib/core/objects_spec.rb +38 -0
- data/spec/lib/core/resources_spec.rb +12 -0
- data/spec/lib/core/vector_utilities_spec.rb +18 -0
- data/spec/lib/core/wave_spec.rb +1 -0
- data/spec/lib/core/waves_spec.rb +28 -0
- metadata +9 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.8
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Environment do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@environment = Environment.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should be a CP::Space" do
|
10
|
+
@environment.should be_kind_of(CP::Space)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "remove" do
|
14
|
+
before(:each) do
|
15
|
+
@shape = stub :shape, :body => :some_body
|
16
|
+
@thing = stub :thing, :shape => @shape
|
17
|
+
end
|
18
|
+
it "should description" do
|
19
|
+
@environment.should_receive(:remove_body).once.with :some_body
|
20
|
+
@environment.should_receive(:remove_shape).once.with @shape
|
21
|
+
|
22
|
+
@environment.remove @thing
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Objects do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@things = stub :things
|
7
|
+
@sprites = stub :sprites
|
8
|
+
@objects = Objects.new @things, @sprites
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "move" do
|
12
|
+
it "should delegate move to both" do
|
13
|
+
@things.should_receive(:move).once.with
|
14
|
+
@sprites.should_receive(:move).once.with
|
15
|
+
|
16
|
+
@objects.move
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "draw" do
|
21
|
+
it "should delegate draw to both" do
|
22
|
+
@things.should_receive(:draw).once.with
|
23
|
+
@sprites.should_receive(:draw).once.with
|
24
|
+
|
25
|
+
@objects.draw
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "remove_marked" do
|
30
|
+
it "should delegate remove_marked to both" do
|
31
|
+
@things.should_receive(:remove_marked).once.with
|
32
|
+
@sprites.should_receive(:remove_marked).once.with
|
33
|
+
|
34
|
+
@objects.remove_marked
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Resources do
|
4
|
+
|
5
|
+
it "should have an writer root" do
|
6
|
+
lambda { Resources.root = :some_root }.should_not raise_error
|
7
|
+
end
|
8
|
+
it "should have an reader root" do
|
9
|
+
lambda { Resources.root }.should_not raise_error
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '/../../spec_helper')
|
2
|
+
|
3
|
+
describe VectorUtilities do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@vectored = Class.new { include VectorUtilities }.new
|
7
|
+
end
|
8
|
+
|
9
|
+
describe 'random_vector' do
|
10
|
+
it 'should return a CP::Vec2' do
|
11
|
+
@vectored.random_vector.should be_kind_of(CP::Vec2)
|
12
|
+
end
|
13
|
+
it "'s length should be defined by the param" do
|
14
|
+
@vectored.random_vector(5).length.should == 5
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# TODO
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Waves do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@window = stub :window
|
7
|
+
@scheduling = stub :scheduling
|
8
|
+
@waves = Waves.new @window, @scheduling
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "add" do
|
12
|
+
it "should create a new wave and delegate" do
|
13
|
+
time = stub :time
|
14
|
+
type = stub :type
|
15
|
+
times = stub :times
|
16
|
+
block = lambda {}
|
17
|
+
wave = stub :wave
|
18
|
+
Wave.should_receive(:new).once.with(type, times, &block).and_return wave
|
19
|
+
|
20
|
+
@waves.should_receive(:add_wave).once.with time, wave
|
21
|
+
|
22
|
+
@waves.add time, type, times, &block
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# TODO add_wave
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 8
|
9
|
+
version: 0.3.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Florian Hanke
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-05-
|
18
|
+
date: 2010-05-16 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -136,12 +136,18 @@ test_files:
|
|
136
136
|
- spec/lib/core/collision_spec.rb
|
137
137
|
- spec/lib/core/control_spec.rb
|
138
138
|
- spec/lib/core/controls_spec.rb
|
139
|
+
- spec/lib/core/environment_spec.rb
|
139
140
|
- spec/lib/core/initializer_hooks_spec.rb
|
140
141
|
- spec/lib/core/it_is_a_spec.rb
|
141
142
|
- spec/lib/core/layer_spec.rb
|
143
|
+
- spec/lib/core/objects_spec.rb
|
144
|
+
- spec/lib/core/resources_spec.rb
|
142
145
|
- spec/lib/core/threading_spec.rb
|
143
146
|
- spec/lib/core/trait_spec.rb
|
144
147
|
- spec/lib/core/traits_spec.rb
|
148
|
+
- spec/lib/core/vector_utilities_spec.rb
|
149
|
+
- spec/lib/core/wave_spec.rb
|
150
|
+
- spec/lib/core/waves_spec.rb
|
145
151
|
- spec/lib/extensions/module_spec.rb
|
146
152
|
- spec/lib/extensions/numeric_spec.rb
|
147
153
|
- spec/lib/traits/attachable_spec.rb
|