ribosome 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+38/−3 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Ribosome.Data.ScratchOptions: instance Data.Default.Class.Default Ribosome.Data.ScratchOptions.ScratchOptions
Files
- lib/Ribosome/Data/ScratchOptions.hs +5/−0
- ribosome.cabal +3/−2
- test/f/SpecMain.hs +2/−1
- test/u/ScratchSpec.hs +27/−0
- test/u/SpecMain.hs +1/−0
lib/Ribosome/Data/ScratchOptions.hs view
@@ -3,6 +3,8 @@ defaultScratchOptions, ) where +import Data.Default.Class (Default(def))+ data ScratchOptions = ScratchOptions { tab :: Bool,@@ -14,3 +16,6 @@ defaultScratchOptions :: String -> ScratchOptions defaultScratchOptions = ScratchOptions False False Nothing False++instance Default ScratchOptions where+ def = defaultScratchOptions "scratch"
ribosome.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 3044c78924fbc3f752664beb04fcb36f3821d795c7a8fc89a0ecdfa32e894805+-- hash: 3ce2af49c339666be3a190f46d20dc3ff8292ac3ffedf9e8b62bdc4c3f04a67f name: ribosome-version: 0.1.0.0+version: 0.1.1.0 synopsis: api extensions for nvim-hs description: Please see the README on GitHub at <https://github.com/tek/proteome-hs> category: Neovim@@ -137,6 +137,7 @@ type: exitcode-stdio-1.0 main-is: SpecMain.hs other-modules:+ ScratchSpec Paths_ribosome hs-source-dirs: test/u
test/f/SpecMain.hs view
@@ -6,4 +6,5 @@ import Test.Framework.BlackBoxTest () main :: IO ()-main = htfMain htf_importedTests+main = return ()+-- main = htfMain htf_importedTests
+ test/u/ScratchSpec.hs view
@@ -0,0 +1,27 @@+{-# OPTIONS_GHC -F -pgmF htfpp #-}++module ScratchSpec(+ htf_thisModulesTests+) where++import Control.Monad.IO.Class (liftIO)+import Data.Default.Class (def)+import Test.Framework+import Ribosome.Api.Buffer (currentBufferContent)+import Ribosome.Data.ScratchOptions (ScratchOptions(ScratchOptions))+import Ribosome.Scratch (showInScratch)+import Ribosome.Control.Ribo (Ribo)+import Ribosome.Test.Unit (unitSpec)++target :: [String]+target = ["line 1", "line 2"]++scratchSpec :: Ribo e ()+scratchSpec = do+ _ <- showInScratch target (ScratchOptions False True (Just 0) False "buffi")+ content <- currentBufferContent+ liftIO $ assertEqual target content++test_scratch :: IO ()+test_scratch =+ unitSpec def () scratchSpec
test/u/SpecMain.hs view
@@ -2,6 +2,7 @@ module Main where +import {-@ HTF_TESTS @-} ScratchSpec import Test.Framework import Test.Framework.BlackBoxTest ()