sashite-pan 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/VERSION.semver +1 -1
- data/lib/sashite/pan/drop.rb +3 -3
- data/test/_test_helper.rb +1 -1
- data/test/test_drop.rb +5 -5
- data/test/{test_movement.rb.rb → test_movement.rb} +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b34d7729fc0d82a1d1c2c86159962a4833440f7b
|
4
|
+
data.tar.gz: 20f7db3f64d3300f646ebb4c1abcf1cc0f911c9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44bf0808b56d9905d7c28b5e8045bba47938d280cf3c8822261a9c334719f1e59f1d971081f0543fe59dc94013364161d3e691a6cbef578808daf2bccae4c7ec
|
7
|
+
data.tar.gz: 7c3593b2d96924d43477a612096d9d6438b0198caf97747d809f47d685f00f863edcd039cadc60a325ffcb90b3e542a0c0c656b7aca7f73aca56546824306ec5
|
data/README.md
CHANGED
@@ -24,10 +24,12 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
## Example
|
26
26
|
|
27
|
-
|
27
|
+
```ruby
|
28
|
+
require 'sashite-pan'
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
action = Sashite::PAN.load :shift, 42, 43
|
31
|
+
action.src_square # => 42
|
32
|
+
```
|
31
33
|
|
32
34
|
## Contributing
|
33
35
|
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/sashite/pan/drop.rb
CHANGED
@@ -3,7 +3,7 @@ module Sashite
|
|
3
3
|
class Drop
|
4
4
|
attr_reader :actor, :dst_square
|
5
5
|
|
6
|
-
def initialize
|
6
|
+
def initialize dst_square, actor
|
7
7
|
raise TypeError unless actor.is_a? Symbol
|
8
8
|
raise TypeError unless dst_square.is_a? Fixnum
|
9
9
|
|
@@ -14,8 +14,8 @@ module Sashite
|
|
14
14
|
def to_a
|
15
15
|
[
|
16
16
|
self.class.name.split('::').last.downcase.to_sym,
|
17
|
-
@
|
18
|
-
@
|
17
|
+
@dst_square,
|
18
|
+
@actor
|
19
19
|
]
|
20
20
|
end
|
21
21
|
end
|
data/test/_test_helper.rb
CHANGED
data/test/test_drop.rb
CHANGED
@@ -4,25 +4,25 @@ describe Sashite::PAN do
|
|
4
4
|
describe 'drops' do
|
5
5
|
describe 'errors' do
|
6
6
|
it 'raises a type error from the actor' do
|
7
|
-
-> { Sashite::PAN.load :drop, 'foobar'
|
7
|
+
-> { Sashite::PAN.load :drop, 42, 'foobar' }.must_raise TypeError
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'raises a type error from the destination square' do
|
11
|
-
-> { Sashite::PAN.load :drop,
|
11
|
+
-> { Sashite::PAN.load :drop, '42', :foobar }.must_raise TypeError
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
describe 'instances' do
|
16
16
|
before do
|
17
|
-
@action = Sashite::PAN.load :drop, :foobar
|
17
|
+
@action = Sashite::PAN.load :drop, 42, :foobar
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'returns the action' do
|
21
|
-
@action.to_a.must_equal [ :drop, :foobar
|
21
|
+
@action.to_a.must_equal [ :drop, 42, :foobar ]
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'returns the action (once again)' do
|
25
|
-
@action.to_a.must_equal Sashite::PAN::Drop.new(:foobar
|
25
|
+
@action.to_a.must_equal Sashite::PAN::Drop.new(42, :foobar).to_a
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'returns the actor of the action' do
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sashite-pan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ files:
|
|
81
81
|
- test/_test_helper.rb
|
82
82
|
- test/test_capture.rb
|
83
83
|
- test/test_drop.rb
|
84
|
-
- test/test_movement.rb
|
84
|
+
- test/test_movement.rb
|
85
85
|
- test/test_pan.rb
|
86
86
|
- test/test_promote.rb
|
87
87
|
- test/test_remove.rb
|
@@ -114,7 +114,7 @@ test_files:
|
|
114
114
|
- test/_test_helper.rb
|
115
115
|
- test/test_capture.rb
|
116
116
|
- test/test_drop.rb
|
117
|
-
- test/test_movement.rb
|
117
|
+
- test/test_movement.rb
|
118
118
|
- test/test_pan.rb
|
119
119
|
- test/test_promote.rb
|
120
120
|
- test/test_remove.rb
|