Errata

Testing in Scala

Errata for Testing in Scala

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page viii
3rd paragraph

The text says: "The koans by yourself which is the lonely way to go, or at a local conference where it is interactive and conducive to more questions and answers."

I don't know if this was meant to say "You can learn the koans by yourself ..."

As it is, however, the sentence reads oddly.

Jeff Nyman  Jul 31, 2013 
PDF Page ix
2nd paragraph

The text says: "This chapter covers an amazing tool that generates fake data for tests and does so thoroughly by creating a set of fake data for tests."

I have to believe that this sentence was made to say something else because basically it just says "the fake data generator generates fake data." Which we would sort of be able to guess on our own. :)

Jeff Nyman  Jul 31, 2013 
Mobi United Kingdom

Location 284 gives examples of libraryDependencies in build.sbt. following these (and trying others from StackOverflow and elsewhere), I cannot eradicate the sbt errors generated by the MustMatcherSpec.scala when it tries to resolve and compile the java portion of the code, from:

it("has method for java collections") {
import java.util.{List => JList, ArrayList ⇒ JArrayList,
Map ⇒ JMap, HashMap ⇒ JHashMap}


I get the sbt error (see red error - I've left in the green info to show where it works):

[info] Using all must matchers
[info] - has simple matchers
[info] - has string matchers
[info] - has <, >, <=, >=, === matchers
[info] - has theSameInstanceAs
[info] - has checking floating point imperfections
[info] - has methods for iterable
[info] - has methods for seq
[info] - has methods for traversable
[info] - has methods for map
[trace] Stack trace suppressed: run last test:test for the full output.
[error] Could not run test com.oreilly.testingscala.MustMatcherSpec2: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
[error] Error: Total 3, Failed 0, Errors 0, Passed 3
[error] Error during tests:
[error] com.oreilly.testingscala.MustMatcherSpec2
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful

I cannot resolve the ** java.lang.NoClassDefFpoundError: scala/collection/GenTraversableOnce$class ** error, even with changes to build .sbt.

Tony Rowley  Mar 17, 2015 
PDF Page 1
1st paragraph

The github link given for Simple Build Tool is https://github.com/harrah/xsbt, however that has not been correct for some time now. The correct link is:

https://github.com/sbt/sbt

Also, it might make more sense to link to the page that is dedicated to SBT:

http://www.scala-sbt.org/

That way if the Github repo changes again, at least the main web page for the tool will reflect that.

Jeff Nyman  Jul 31, 2013 
PDF Page 3
last paragraph

The paragraph mentions "ScalaMock, formerly known as Mockito". It should probably read "formerly known as Borachio".

csage  Feb 07, 2013 
PDF Page 3
last paragraph

The sentence reads:

"Also note that the declaration consains a scope for our dependency."

Here "consains" should be "contains".

Jeff Nyman  Jul 31, 2013 
PDF Page 4
1st paragraph

The text says:

"At the command prompt, it is possible to call run sbt reload update to combine operations."

The use of "call run" there seems like one word or the other was meant, either "call" or "run". I would opt for "run".

Jeff Nyman  Jul 31, 2013 
PDF Page 4
6th paragraph

The text says:

"Each album will with have an artist associated with it."

The "will with" is in error; most likely the 'with' can be removed.

Jeff Nyman  Jul 31, 2013 
PDF Page 4
last paragraph

The text says:

"Each song will need to persisted into some sort of database, ..."

Clearly it should be "need to BE persisted..."

Jeff Nyman  Jul 31, 2013 
PDF Page 13
1st paragraph

In pdf:

"run view resolvers and the sbt prompt."

should be

"run show resolvers in sbt prompt"

Anonymous  May 24, 2013 
PDF Page 14
Last paragraph

PDF:

withJavadocs()

Should be

withJavadoc()

Anonymous  May 24, 2013 
PDF Page 28
Code in Property matchers

"new Artist("Ozzy", "Osbourne")

won't work with the "should have" assertion in "album" as they refers to two different objects

Anonymous  May 24, 2013 
Printed Page 29
first paragraph

The first paragraph afther the snippet it says "ArrayList will be referred to as JList". It should be JArrayLisy "ArrayList will be referred to as JArrayList" as JList was declared previously as an alias for java.util.List

Juna Carlos G?mez  Aug 09, 2013 
PDF Page 38
United States

The creation of the Album object should have the Band wrapped in a List and the Artists that make up the Band should be wrapped in the list. Code......

new Album("Hotel California", 1977,
List(new Band("The Eagles", List (new Artist("Don", "Henley"),
new Artist("Glenn", "Frey"),
new Artist("Joe", "Walsh"),
new Artist("Randy", "Meisner"),
new Artist("Don", "Felder")))))

Michael Napoleon  Jul 01, 2013 
Mobi Page 284
United Kingdom

Update to previous post:
Error removed by updating ScalaTest and changing build.sbt.

this works:

name := "Testing scala"

version := "1.0"

scalaVersion := "2.11.6"

autoScalaLibrary := true

libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"


To be safe, I then issued commands in sbt: clean; reload, update

Compile now does not report the ** java.lang.NoClassDefFoundError **

Tony Rowley  Mar 17, 2015 
Mobi Page 520
Bringing some sources and documentation

libraryDependencies code example ends withJavadocs(). It should be withJavadoc(). Extra 's'. Same error in the sentence following the example.

Brian Hanafee  Dec 26, 2012 
Mobi Page 1155
WordSpec, below AlbumWordSpec.scala listing

The paragraph starting "Another concept from the last example that may unfamiliar [sic] is List(): _*
The description of the construct is clear enough, but might be confusing since the example doesn't actually use that construct.

Possibly an earlier iteration of the example declared something like val acts = List(new Artist("Glenn", "Frey"), new Artist("Joe", "Walsh"), new Artist("Randy", "Meisner"), new Artist("Don", "Felder")) and passed it as args: _* to the new Album(...)?

Brian Hanafee  Dec 26, 2012 
Mobi Page 1459
Anonymous Objects, val letterFromHome

Just pointing this one out because proofreaders might miss it: "Metheny" is misspelled as "Methany" in the value declaration in the fixture.

Brian Hanafee  Dec 27, 2012 
Mobi Page 1594
Setting up Specs2 in SBT

Repositories at scala-tools.org appear to be dead. Message on the site directs users to https://oss.sonatype.org/content/groups/scala-tools/ or https://oss.sonatype.org/content/repositories/snapshots/.

Same issue in first section of Chapter 7 ScalaCheck

Brian Hanafee  Dec 30, 2012