samedi 23 juillet 2016

Groovy: separate spock test files from program files

I have done a simple fizzbuzz program in groovy, using Spock as the test framework. This is done using a terminal and atom editor, in MacOs.

The code is here at my GitHub page: http://ift.tt/2anJ8BQ

I want to be able to separate out the test files in a test folder, and the program files in the lib folder like below

-> FizzBuzz/
    -> lib/
        -> FizzBuzz.groovy

    -> tests/
        -> FizzBuzzSpec.groovy

When I do this and run the tests(using groovy 'tests/FizzBuzzSpec.groovy') it cannot access the 'FizzBuzz.groovy' file and it's contents.

How do I import or include the FizzBuzz.groovy file into the test file? OR do I have to do something else to make sure the tests are passing with the above file structure?

Aucun commentaire:

Enregistrer un commentaire