You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
valdf=List((User("John", "doe", 34), 1))
.toDF("col", "delete")
.select("col")
...
it("throws an error if the sub column is not of the provided type") {
colStruct("col")
.getChild[String]("age")
.elem
.run(df)
.toEither
.left
.value
.head shouldBe ColumnTypeError("col.age", StringType, IntegerType)
it'd be nice to write something like this:
it("..."){
df.select(colStruct("col").getChild[String]("age")) should
failWith(ColumnTypeError("col.age", StringType, IntegerType))
}
In general, testing should not expose implementation details, and stick itself to the programmer API whenever possible.
The text was updated successfully, but these errors were encountered:
Testing might be improved with custom matchers.
For instance, instead of:
it'd be nice to write something like this:
In general, testing should not expose implementation details, and stick itself to the programmer API whenever possible.
The text was updated successfully, but these errors were encountered: