Skip to content

Commit

Permalink
Remove last .gets
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Feb 20, 2015
1 parent 9f42453 commit 98edbff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion enumeratum-play/src/test/scala/enumeratum/JsonSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class JsonSpec extends FunSpec with Matchers {
val format = Json.formats(Dummy)

it("should create a format that works with valid values") {
format.reads(JsString("A")).asOpt.get should be(Dummy.A)
format.reads(JsString("A")).asOpt.value should be(Dummy.A)
}

it("should create a format that fails with invalid values") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package enumeratum

import UrlBinders._
import org.scalatest._
import org.scalatest.OptionValues._
import org.scalatest.EitherValues._

/**
* Created by Lloyd on 2/3/15.
Expand All @@ -13,7 +15,7 @@ class UrlBindersSpec extends FunSpec with Matchers {
val subject = pathBinder(Dummy)

it("should create an enumeration binder that can bind strings corresponding to enum strings") {
subject.bind("hello", "A").right.get shouldBe Dummy.A
subject.bind("hello", "A").right.value shouldBe Dummy.A
}

it("should create an enumeration binder that cannot bind strings not found in the enumeration") {
Expand All @@ -32,11 +34,11 @@ class UrlBindersSpec extends FunSpec with Matchers {
val subject = queryBinder(Dummy)

it("should create an enumeration binder that can bind strings corresponding to enum strings regardless of case") {
subject.bind("hello", Map("hello" -> Seq("A"))).get.right.get should be(Dummy.A)
subject.bind("hello", Map("hello" -> Seq("A"))).value.right.value should be(Dummy.A)
}

it("should create an enumeration binder that cannot bind strings not found in the enumeration") {
subject.bind("hello", Map("hello" -> Seq("Z"))).get should be('left)
subject.bind("hello", Map("hello" -> Seq("Z"))).value should be('left)
subject.bind("hello", Map("helloz" -> Seq("A"))) shouldBe None
}

Expand Down

0 comments on commit 98edbff

Please sign in to comment.