Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Forked from igrigorik/output.txt
Created October 30, 2011 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baroquebobcat/1326332 to your computer and use it in GitHub Desktop.
Save baroquebobcat/1326332 to your computer and use it in GitHub Desktop.
test.mirah
~/hacking/fresh_mirah]$ bundle exec mirahc -V test.mirah
Parsing...
test.mirah
Inferring types...
* [Mirah::Typer] New type defined: 'Test' < ''
* [Mirah::Typer] Learned local type under #<Mirah::AST::StaticScope:0x39e2ee3f> : test = Type(boolean)
* [AST] [RequiredArgument] RequiredArgument(test) resolved!
...
NoMethodError: undefined method `defining_class' for #<Mirah::AST::Block:0x4c4947d3>
prepare at /Users/nick/hacking/fresh_mirah/lib/mirah/ast/structure.rb:147
infer at /Users/nick/hacking/fresh_mirah/lib/mirah/ast/call.rb:200
t.should "do stuff" do
^^^^^^^^^^^^^^^^^^^^^^^^^
t.assert false
^^^^^^^^^^^^^^^^^^^
end
^^^^^
class Test
def assert(test:boolean, msg:string)
msg ||= "Failed assertion, no message given."
if not test
raise Exception, msg
end
true
end
def should(desc:string, block:Runnable)
puts "should: #{desc}"
block.run
end
def describe(desc:string, block:Runnable)
puts "describe: #{desc}"
block.run
end
end
t = Test.new
t.describe "spec thing" do
t.should "do stuff" do
t.assert false
end
end
puts "Hai"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment