scash 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scash.rb +1 -2
- data/lib/scash/version.rb +1 -1
- data/test/test_scash.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50b2f94b76de1c9fbd0867043e4d130ee069368e
|
4
|
+
data.tar.gz: b7cdbf6ad0bbb527cc4a3be066bd48ac79a5e284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1f0bfb1cc25491e14415880a779b4d1bd57408b67d110c375fca3564a6621129fab4b5fd26543d73dc1cca578c47a9f48fa4eb519c3c203ef6f7342a0536d1
|
7
|
+
data.tar.gz: 8cca5809b87ea8571e20a1c830b3bdafe6442b672fb7eeec1d515aebad3ddb9b3350562b86d1fe21dbdcec2b9bc4847ae4a8b318cfdc802e046591a7715fe8f4
|
data/lib/scash.rb
CHANGED
data/lib/scash/version.rb
CHANGED
data/test/test_scash.rb
CHANGED
@@ -61,6 +61,19 @@ class TestScash < Minitest::Test
|
|
61
61
|
assert_equal({}, scash.to_hash)
|
62
62
|
end
|
63
63
|
|
64
|
+
it "should accept variables in initializer" do
|
65
|
+
scash = Scash.new({:a => 1})
|
66
|
+
assert_equal 1, scash[:a]
|
67
|
+
assert_equal({"a" => 1}, scash.to_hash)
|
68
|
+
scash.with({:b => 2}) do
|
69
|
+
assert_equal 1, scash[:a]
|
70
|
+
assert_equal 2, scash[:b]
|
71
|
+
scash.define_global_variables :c => 3
|
72
|
+
end
|
73
|
+
assert_equal 1, scash[:a]
|
74
|
+
assert_equal 3, scash[:c]
|
75
|
+
end
|
76
|
+
|
64
77
|
it "should reuse instances" do
|
65
78
|
class Foo
|
66
79
|
attr_accessor :bar
|