1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00
semantic/test/Analysis/Ruby/Spec.hs

26 lines
627 B
Haskell
Raw Normal View History

2018-03-14 02:19:26 +03:00
{-# LANGUAGE TypeApplications #-}
module Analysis.Ruby.Spec (spec) where
import Data.Abstract.Value
import Data.Map
import SpecHelpers
spec :: Spec
spec = parallel $ do
describe "evalutes Ruby" $ do
it "require_relative method" $ do
env <- evaluate "main.rb"
2018-03-14 02:19:26 +03:00
let expectedEnv = Environment $ fromList [ (qualifiedName ["foo"], addr 0) ]
env `shouldBe` expectedEnv
2018-03-14 02:19:26 +03:00
where
addr = Address . Precise
fixtures = "test/fixtures/ruby/analysis/"
evaluate entry = snd . fst . fst . fst <$>
2018-03-14 02:19:26 +03:00
evaluateFiles @RubyValue rubyParser
[ fixtures <> entry
, fixtures <> "foo.rb"
]