Prabhu Sunderaraman

Picking up Scala

Picking up Scala

I generally like to pick up one new language and technology every year. And these days the language that has me hooked is Scala. My interest in Scala shot up after the advent of social media web sites where concurrency […]

Spock for Groovy – IV

In this last post of using Spock with Groovy, let’s learn to use mock objects. We’ll continue to use the Calculator class. The Calculator class has the add method that returns the sum of two numbers. Let’s modify the add […]

Spock for Groovy – III

Continuing with the series of posts on Spock framework for Groovy, let’s discuss testing the exceptions for the Calculator class. The Calculator class with two methods add and divide are given below. //Calculator.groovy class Calculator { def add(num1,num2){ num1 + […]

Spock for Groovy – II

In the previous post, we got introduced to Spock framework. We created a Calculator class with an add method and a spec called CalculatorSpec with a feature to test the add method. Let’s add some more test features in our […]

Spock for Groovy – I

The DSL capability of Groovy is a well known fact. When it comes to writing test cases for Groovy/Grails applications the API has always been not a very pleasant one. People talk about the unit tests being the best documentation […]