bitmask 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -0
- data/lib/bitmask.rb +2 -2
- data/lib/bitmask/version.rb +1 -1
- data/test/bitmask_test.rb +11 -8
- metadata +3 -3
data/Rakefile
CHANGED
data/lib/bitmask.rb
CHANGED
data/lib/bitmask/version.rb
CHANGED
data/test/bitmask_test.rb
CHANGED
@@ -37,14 +37,17 @@ class BitmaskTest < Test::Unit::TestCase
|
|
37
37
|
|
38
38
|
def test_to_a
|
39
39
|
bitmask = Bitmask.new TEST_MASKS, :phone => true, :name => true, :email => true
|
40
|
-
assert_equal([
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
40
|
+
assert_equal([:phone, :name, :email], bitmask.to_a)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_each
|
44
|
+
bitmask = Bitmask.new TEST_MASKS, :phone => true, :name => true, :email => true
|
45
|
+
results = {}
|
46
|
+
bitmask.each do |k, v|
|
47
|
+
results[k] = v
|
48
|
+
end
|
49
|
+
|
50
|
+
assert_equal({:phone => true, :name => true, :email => true, :gender => false, :birthday => false, :location => false}, results)
|
48
51
|
end
|
49
52
|
|
50
53
|
def test_defaults
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitmask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Represents a set of boolean values as an Integer
|
15
15
|
email:
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
50
|
rubyforge_project:
|
51
|
-
rubygems_version: 1.8.
|
51
|
+
rubygems_version: 1.8.24
|
52
52
|
signing_key:
|
53
53
|
specification_version: 3
|
54
54
|
summary: Bitmask represents a set of boolean values as an Integer using bitwise arithmetic. This
|