dougp-shatter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/test/shatter_test.rb +26 -0
  2. 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.1
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