Skip to content

Commit

Permalink
Add test for instance_extract. [test]
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed May 24, 2014
1 parent e11e0d7 commit e6b42a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/core/kernel/test_instance_extract.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
covers 'facets/kernel/extract'

test_case Kernel do

method :extract do

test "extracts hash into object" do
c = Class.new do
def initialize
@cmd='cls'
end
def cmd
@cmd
end
def page
@page
end
end

o = c.new
o.extract('cmd'=>'hello','page'=>'frontpage')
o.cmd.assert == 'cls'
o.page.assert == 'frontpage'
end

end

end

0 comments on commit e6b42a2

Please sign in to comment.