Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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