1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

fix the specs

This commit is contained in:
Patrick Thomson 2018-03-23 11:50:53 -04:00
parent 7f5460bdd1
commit dce0f5c277

View File

@ -13,18 +13,20 @@ spec = parallel $ do
describe "evalutes Ruby" $ do
it "require_relative" $ do
env <- evaluate "main.rb"
let expectedEnv = [ (qualifiedName ["foo"], addr 0) ]
let expectedEnv = [ (qualifiedName ["Object"], addr 0)
, (qualifiedName ["foo"], addr 3)]
env `shouldBe` expectedEnv
it "load" $ do
env <- evaluate "load.rb"
let expectedEnv = [ (qualifiedName ["foo"], addr 0) ]
let expectedEnv = [ (qualifiedName ["Object"], addr 0)
, (qualifiedName ["foo"], addr 3) ]
env `shouldBe` expectedEnv
it "load wrap" $ do
res <- evaluate' "load-wrap.rb"
fst res `shouldBe` Left "free variable: \"foo\""
snd res `shouldBe` []
snd res `shouldBe` [(qualifiedName ["Object"], addr 0)]
it "subclass" $ do
res <- evaluate' "subclass.rb"
@ -32,7 +34,7 @@ spec = parallel $ do
it "has prelude" $ do
res <- evaluate' "preluded.rb"
fst res `shouldBe` Right (injValue (String "\"<foo>\""))
fst res `shouldBe` Right (injValue (String "\"<foo>\""))
where
addr = Address . Precise