dougp-shatter 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/test/shatter_test.rb +26 -0
- metadata +2 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require '../lib/shatter'
|
3
|
+
class ShatterTest < Test::Unit::TestCase
|
4
|
+
def test_basic
|
5
|
+
assert(TestBase.new.basic(:one=>1,:two=>2,:three=>3)==6)
|
6
|
+
end
|
7
|
+
def test_method_conflict
|
8
|
+
assert(TestBase.new.conflict(:message=>"world", :override=>"wrong")=="hello world")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
class TestBase
|
12
|
+
include Shatter
|
13
|
+
def basic parameters={}
|
14
|
+
shatter(parameters) do
|
15
|
+
one + two + three
|
16
|
+
end
|
17
|
+
end
|
18
|
+
def conflict parameters={}
|
19
|
+
shatter(parameters) do
|
20
|
+
"#{override} #{message}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
def override
|
24
|
+
"hello"
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dougp-shatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug Peterson
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- License
|
26
26
|
- README
|
27
27
|
- lib/shatter.rb
|
28
|
+
- test/shatter_test.rb
|
28
29
|
- Rakefile
|
29
30
|
has_rdoc: false
|
30
31
|
homepage: http://github.com/dougp/shatter
|