mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
456fa3a282
good?
34 lines
679 B
Ruby
34 lines
679 B
Ruby
require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
|
|
describe "The Ruby Racer" do
|
|
|
|
before(:each) do
|
|
@cxt = V8::Context.new
|
|
end
|
|
|
|
describe "Type Conversion from Ruby to Javascript" do
|
|
|
|
it "can pass strings back to ruby" do
|
|
eval("'Hello World'").should == "Hello World"
|
|
end
|
|
|
|
it "can pass doubles back to ruby" do
|
|
eval("2.5").should == 2.5
|
|
end
|
|
|
|
it "can pass fixed numbers back to ruby" do
|
|
eval("1").should == 1
|
|
end
|
|
|
|
it "can pass boolean values back to ruby" do
|
|
eval("true").should be(true)
|
|
eval("false").should be(false)
|
|
end
|
|
|
|
end
|
|
|
|
def eval(str)
|
|
@cxt.eval(str)
|
|
end
|
|
|
|
end
|