Skip to content

Commit

Permalink
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/truffle/specs/truffle/interop/unbox_spec.rb
Original file line number Diff line number Diff line change
@@ -9,6 +9,22 @@
require_relative '../../../../ruby/spec_helper'

describe "Truffle::Interop.unbox" do

it "passes through fixnums" do
Truffle::Interop.unbox(14).should == 14
end

it "passes through floats" do
Truffle::Interop.unbox(14.2).should == 14.2
end

it "passes through true" do
Truffle::Interop.unbox(true).should == true
end

it "passes through false" do
Truffle::Interop.unbox(false).should == false
end

it "doesn't work on empty strings" do
lambda { Truffle::Interop.unbox('') }.should raise_error(RubyTruffleError)

0 comments on commit 94aa8d3

Please sign in to comment.