cellular_map 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,5 +44,10 @@ module CellularMap
44
44
  def to_a
45
45
  @store.keys.collect { |k| Cell.new(*(k + [self])) }
46
46
  end
47
+
48
+ # Empties the map filled cells.
49
+ def empty!
50
+ @store = {}
51
+ end
47
52
  end
48
53
  end
data/test/test_map.rb CHANGED
@@ -52,5 +52,10 @@ class TestMap < Test::Unit::TestCase
52
52
  res.each { |c| inside[[c.x, c.y]] = c.content }
53
53
  assert_equal @sample, inside
54
54
  }
55
+
56
+ should("be emptied at will") {
57
+ @map.empty!
58
+ @map.each { |cell| flunk "There should be no more filled cells." }
59
+ }
55
60
  }
56
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cellular_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Belleville
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-29 00:00:00 +01:00
12
+ date: 2010-01-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency