Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jeffreyolchovy/7cef6863db768c9ea61d1850b7596407 to your computer and use it in GitHub Desktop.

Select an option

Save jeffreyolchovy/7cef6863db768c9ea61d1850b7596407 to your computer and use it in GitHub Desktop.
package sbttweeter
import sbt._
import sbt.Keys._
object TweeterKeys {
/* Instantiate your setting, task, and input task keys here */
}
object TweeterPlugin extends AutoPlugin {
object autoImport {
/* Whatever you want brought into scope automatically for users of your plugin */
val TweeterKeys = sbttweeter.TweeterKeys
}
override def projectSettings = Seq(
/* Whatever settings/behavior you want to make available to the project that includes your plugin */
)
}
package com.example.sbt
import scala.util.Try
trait TweeterService {
def post(tweet: String): Try[_]
}
package com.example.sbt
import scala.util.Failure
import org.scalatest.{FlatSpec, Matchers}
class TweeterServiceSpec extends FlatSpec with Matchers {
behavior of "TweeterService"
it should "return a failure when ..." in {
pending
val service: TweeterService = ???
val result = service.post("This tweet should never make it out!")
result shouldBe a[Failure[_]]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment