Skip to content

Instantly share code, notes, and snippets.

object Test {
case class A(name: String, value: String = "value")
case class B(name: String, value: String = "value")
case class C(name: String, value: String = "value")
implicit val fullAFormater: OFormat[(A, Seq[(B, Seq[C])])] = ((JsPath \ "name").format[String]
#
# Cookbook Name:: java-wrapper
# Recipe:: default
#
# Copyright 2013, Alexandre Russel
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
package com.getpinsights.qa
import dispatch._
import org.apache.http._
import client.methods.HttpGet
import entity.InputStreamEntity
import message.{BasicHttpResponse, BasicStatusLine}
import client.HttpClient
import org.specs2.mock.Mockito
import org.mockito.Mockito._
abstract class Foo(implicit config: Config) {
}
class Bar(config: Config) extends Foo(config) {
def doxxx = {
Obj.doStuff(1)
}
}
object Obj {
import net.liftweb.json.JsonAST.JValue
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
import dispatch.liftjson.Js._
class JsonAssoc[A <% JValue](left: (String, A)) {
def ~[B <% JValue](right: (String, B)) = {
val l: JValue = left._2
val r: JValue = right._2
JObject(JField(left._1, l) :: JField(right._1, r) :: Nil)
}
val http = mock[Http]
when(http.apply(any(manifest[Handler[Any]]))).thenReturn("foo bar", "foo bar")
error: ambiguous implicit values:
[INFO] both method stringIsSized in trait TraversableBaseMatchers of type => org.specs2.data.Sized[String]
[INFO] and method javaCollectionIsSized in trait TraversableBaseMatchers of type [T <: java.util.Collection[_]]org.specs2.data.Sized[T]
[INFO] match expected type org.specs2.data.Sized[T]
[INFO] }).toList must haveSize(1).iff(serverOk)
[INFO] ^
brew install mysql
==> Installing mysql dependency: cmake
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.7-bottle.tar.gz
######################################################################## 100.0%
Error: SHA1 mismatch
Expected: f218ed64ce6e7a5d3670acdd6a18e5ed95421d1f
Got: 3a57f6f44186e0dba34ef8b8fb4a9047e9e5d8a3