main :: IO ()
main = do
  config :: Config <- fromJust <$> decodeFile "test/testdata/kubeconfig.yaml"
  hspec $ do
    describe "FromJSON and ToJSON instances" $ do
      it "roundtrips successfully" $ do
        decode (encode (toJSON config)) `shouldBe` Just config
    describe "getContext" $ do
      it "returns the correct context" $ do
        getContext config `shouldBe` (Right (Context "cluster-aaa" "user-aaa" Nothing))

    describe "getCluster" $ do
      it "returns the correct cluster" $ do
        server <$> getCluster config `shouldBe` (Right "https://aaa.example.com")

    describe "getAuthInfo" $ do
      it "returns the correct authInfo" $ do
        fst <$> getAuthInfo config `shouldBe` (Right "user-aaa")
main :: IO ()
main = do
  config :: Config <- fromJust <$> decodeFile "test/testdata/kubeconfig.yaml"
  hspec $ do
    describe "FromJSON and ToJSON instances" $ do
      it "roundtrips successfully" $ do
        decode (encode (toJSON config)) `shouldBe` Just config
    describe "getContext" $ do
      it "returns the correct context" $ do
        getContext config `shouldBe` (Right (Context "cluster-aaa" "user-aaa" Nothing))

    describe "getCluster" $ do
      it "returns the correct cluster" $ do
        server <$> getCluster config `shouldBe` (Right "https://aaa.example.com")

    describe "getAuthInfo" $ do
      it "returns the correct authInfo" $ do
        fst <$> getAuthInfo config `shouldBe` (Right "user-aaa")
main = do
  config :: Config <- fromJust <$> decodeFile "test/testdata/kubeconfig.yaml"
  hspec $ do
    describe "FromJSON and ToJSON instances" $ do
      it "roundtrips successfully" $ do
        decode (encode (toJSON config)) `shouldBe` Just config
    describe "getContext" $ do
      it "returns the correct context" $ do
        getContext config `shouldBe` (Right (Context "cluster-aaa" "user-aaa" Nothing))

    describe "getCluster" $ do
      it "returns the correct cluster" $ do
        server <$> getCluster config `shouldBe` (Right "https://aaa.example.com")

    describe "getAuthInfo" $ do
      it "returns the correct authInfo" $ do
        fst <$> getAuthInfo config `shouldBe` (Right "user-aaa")