diff options
author | Johannes Rudolph <johannes_rudolph@gmx.de> | 2012-05-31 17:21:41 +0200 |
---|---|---|
committer | Johannes Rudolph <johannes_rudolph@gmx.de> | 2012-05-31 17:21:41 +0200 |
commit | 1bc9ff541993da93aa89bc25c565b32d7ffd8190 (patch) | |
tree | e44b2b40e306fcd45039dc8e5defade0eab9d013 /src/test/scala/cc | |
parent | 55a85a95f18c5ecea837af520de272bd9bfb6028 (diff) | |
download | spray-json-1bc9ff541993da93aa89bc25c565b32d7ffd8190.tar.gz spray-json-1bc9ff541993da93aa89bc25c565b32d7ffd8190.tar.bz2 spray-json-1bc9ff541993da93aa89bc25c565b32d7ffd8190.zip |
rename `Operations.updated` -> modify
Diffstat (limited to 'src/test/scala/cc')
-rw-r--r-- | src/test/scala/cc/spray/json/lenses/JsonLensesSpec.scala | 10 | ||||
-rw-r--r-- | src/test/scala/cc/spray/json/lenses/JsonLensesTest.scala | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/test/scala/cc/spray/json/lenses/JsonLensesSpec.scala b/src/test/scala/cc/spray/json/lenses/JsonLensesSpec.scala index f371f91..c8c88cd 100644 --- a/src/test/scala/cc/spray/json/lenses/JsonLensesSpec.scala +++ b/src/test/scala/cc/spray/json/lenses/JsonLensesSpec.scala @@ -105,13 +105,13 @@ class JsonLensesSpec extends Specification with SpecHelpers { } "update field" in { "existing" in { - """{"n": 12}""" update (n ! updated[Int](_ + 1)) must be_json( """{"n": 13}""") + """{"n": 12}""" update (n ! modify[Int](_ + 1)) must be_json( """{"n": 13}""") } "wrong type" in { - """{"n": 12}""" update (n ! updated[String](_ + "test")) must throwA[DeserializationException]("Expected String as JsString, but got 12") + """{"n": 12}""" update (n ! modify[String](_ + "test")) must throwA[DeserializationException]("Expected String as JsString, but got 12") } "missing" in { - """{"n": 12}""" update (field("z") ! updated[Int](_ + 1)) must throwAn[Exception]( """Expected field 'z' in '{"n":12}'""") + """{"n": 12}""" update (field("z") ! modify[Int](_ + 1)) must throwAn[Exception]( """Expected field 'z' in '{"n":12}'""") } } "set field of member" in { @@ -119,10 +119,10 @@ class JsonLensesSpec extends Specification with SpecHelpers { } "update field of member" in { "existing" in { - """{"n": {"b": 4}}""" update ("n" / "b" ! updated[Int](1 +)) must be_json( """{"n": {"b": 5}}""") + """{"n": {"b": 4}}""" update ("n" / "b" ! modify[Int](1 +)) must be_json( """{"n": {"b": 5}}""") } "parent missing" in { - """{"x": {"b": 4}}""" update ("n" / "b" ! updated[Int](1 +)) must throwAn[Exception]( """Expected field 'n' in '{"x":{"b":4}}'""") + """{"x": {"b": 4}}""" update ("n" / "b" ! modify[Int](1 +)) must throwAn[Exception]( """Expected field 'n' in '{"x":{"b":4}}'""") } } "set element of array" in { diff --git a/src/test/scala/cc/spray/json/lenses/JsonLensesTest.scala b/src/test/scala/cc/spray/json/lenses/JsonLensesTest.scala index b91ecaa..fd44796 100644 --- a/src/test/scala/cc/spray/json/lenses/JsonLensesTest.scala +++ b/src/test/scala/cc/spray/json/lenses/JsonLensesTest.scala @@ -17,7 +17,7 @@ object JsonLensesTest extends App { "els" / element(1) ! update { "money" ! set(38) && "name" ! set("Testperson") - } && "n" ! updated[Int](_ + 1) + } && "n" ! modify[Int](_ + 1) val json = JsonParser("test") val newJson = json("els" / "money") = 12 @@ -30,12 +30,12 @@ object JsonLensesTest extends App { ("els" / * / "money").get[Int] _: (JsValue => Seq[Int]) ("els" / filter("money".is[Int](_ < 30)) / "name").get[String] _: (JsValue => Seq[String]) - "els" / filter("money".is[Int](_ < 30)) / "name" ! updated[String]("Richman " + _) + "els" / filter("money".is[Int](_ < 30)) / "name" ! modify[String]("Richman " + _) //: JsValue => JsValue def updateMoney(x: Int) = - "money" ! updated[Int](_ + x) + "money" ! modify[Int](_ + x) "els" / * ! update(updateMoney(12)) "els" / * ! extract("name") { |