Skip to content

Commit

Permalink
Add JIT specs
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Oct 26, 2011
1 parent 1f116cc commit 501e318
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/jit/fixtures/tier1.rb
@@ -0,0 +1,19 @@
module JITSpecs
class Tier1Specs
def none
nil
end

def one(arg)
arg
end

def strlit
"hello"
end

def str_build(obj)
"-#{obj}-"
end
end
end
15 changes: 15 additions & 0 deletions spec/jit/string_spec.rb
@@ -0,0 +1,15 @@
require File.expand_path("../fixtures/tier1", __FILE__)

describe "tier1 JIT" do
before do
@o = JITSpecs::Tier1Specs.new
end

it "can return a string literal" do
@o.__send_tier1__(:strlit).should == "hello"
end

it "can build a string" do
@o.__send_tier1__(:str_build, 1).should == "-1-"
end
end

0 comments on commit 501e318

Please sign in to comment.