module Magick where magick True = "abacradabra!" magick False = "codewarz"
const magick_message = x => ['codewarz', 'abracadabra!'][+x];- module Magick where
- magick True = "abacradabra!"
- magick False = "codewarz"
module MagickSpec where import Test.Hspec import Magick spec :: Spec spec = do it "simple case" $ do magick True `shouldBe` "abacradabra!" magick False `shouldBe` "codewarz" main = hspec spec
const Test = require('@codewars/test-compat');- module MagickSpec where
describe('Example', function() {it('test case', function() {Test.assertEquals(magick_message(true), 'abracadabra!')Test.assertEquals(magick_message(false), 'codewarz')});});- import Test.Hspec
- import Magick
- spec :: Spec
- spec = do
- it "simple case" $ do
- magick True `shouldBe` "abacradabra!"
- magick False `shouldBe` "codewarz"
- main = hspec spec