Commit 7bd2ea5672a95494c8a3d495c3cef36bb2bda7fb
1 parent
63f275e7
Exists in
master
and in
29 other branches
r231@sede: terceiro | 2007-07-28 17:14:24 -0300
ActionItem0: improving code coverage git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@235 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
18 additions
and
1 deletions
Show diff stats
vendor/plugins/design/lib/design/block.rb
| ... | ... | @@ -27,7 +27,7 @@ module Design |
| 27 | 27 | # Method that define the content code displayed in the box. |
| 28 | 28 | # This method cannot be used directly it will be redefined by the children classes |
| 29 | 29 | def content |
| 30 | - raise "This is a main class, don't use it" | |
| 30 | + raise ArgumentError.new("This is a main class, don't use it") | |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | #TODO see if this method is needed | ... | ... |
vendor/plugins/design/test/block_test.rb
| ... | ... | @@ -43,4 +43,14 @@ class BlockTest < Test::Unit::TestCase |
| 43 | 43 | |
| 44 | 44 | end |
| 45 | 45 | |
| 46 | + def test_main_should_always_return_false | |
| 47 | + assert_equal false, Block.new.main? | |
| 48 | + end | |
| 49 | + | |
| 50 | + def test_should_not_allow_content_in_block_superclass | |
| 51 | + assert_raise ArgumentError do | |
| 52 | + Block.new.content | |
| 53 | + end | |
| 54 | + end | |
| 55 | + | |
| 46 | 56 | end | ... | ... |
vendor/plugins/design/test/proxy_design_holder_test.rb
| ... | ... | @@ -29,4 +29,11 @@ class ProxyDesignHolderTest < Test::Unit::TestCase |
| 29 | 29 | assert_equal [], design.boxes |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | + def test_should_not_proxy_unrelated_method_calls | |
| 33 | + assert_raise NoMethodError do | |
| 34 | + design = Design::ProxyDesignHolder.new(1) | |
| 35 | + design.succ | |
| 36 | + end | |
| 37 | + end | |
| 38 | + | |
| 32 | 39 | end | ... | ... |