Skip to content

A demo to show how Groovy, Gradle, Spock and Scala can be combined into a single project.

Notifications You must be signed in to change notification settings

marc0der/groovy-scala-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Groovy and Scala Demo

Using Groovy, Gradle, Spock to test drive a Scala solution.

  • using Gradle as build system.
  • Spock and Groovy to drive with Data Driven Tests
  • Scala to implement the solution using some nifty tricks.

##The Excercise: FizzBuzz

###Step 1

Write some code that prints out the following for a contiguous range of numbers:

  • the number
  • 'fizz' for numbers that are multiples of 3
  • 'buzz' for numbers that are multiples of 5
  • 'fizzbuzz' for numbers that are multiples of 15

e.g. if I run the program over a range from 1-20 I should get the following output

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz

Archive this as a separate zip file then continue on to step two.

###Step 2 Enhance your existing FizzBuzz solution to perform the following:

  • If the number contains a three you must output the text 'lucky'. This overrides any existing behaviour

e.g. if I run the program over a range from 1-20 I should get the following output

1 2 lucky 4 buzz fizz 7 8 fizz buzz 11 fizz lucky 14 fizzbuzz 16 17 fizz 19 buzz

Archive this as a separate zip file then continue on to step three

About

A demo to show how Groovy, Gradle, Spock and Scala can be combined into a single project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published