Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Professional Scala

You're reading from   Professional Scala Combine object-oriented and functional programming to build high-performance applications

Arrow left icon
Product type Paperback
Published in Jul 2018
Publisher
ISBN-13 9781789533835
Length 186 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Ruslan Shevchenko Ruslan Shevchenko
Author Profile Icon Ruslan Shevchenko
Ruslan Shevchenko
Mads Hartmann Mads Hartmann
Author Profile Icon Mads Hartmann
Mads Hartmann
Arrow right icon
View More author details
Toc

ScalaTest – A Popular DSL


Note

ScalaTest was introduced in Chapter 1, Setting up the Development Environment, but as we'll use it extensively in this lecture, we'll do a little recap here and make sure that everyone has a working ScalaTest environment.

In this section, we'll have a look at a popular library for testing your Scala programs, ScalaTest, and see how the library uses DSLs to allow its users to write readable tests in various styles.

The purpose of looking at ScalaTest is twofold. First off, ScalaTest is a widely used testing library for Scala projects, so you're likely to end up using it when you're using Scala professionally. Secondly, it's a good example of how to use DSLs to make your code more readable.

By the end of this section, you should be able to:

  • Identify how to use ScalaTest in your own projects

  • Identify the various styles that ScalaTest offers and be able to pick the one that's relevant to your project

  • Write ScalaTest tests using the F latSpec style

Adding...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime