Skip to content

bracken/scala_starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Scala Starter Project using SBT and ScalaTest For me, one of the hardest parts about learning a new language is figuring out how to get the correct environment setup where I can run tests. This is just a simple Scala project using SBT and ScalaTest.

I found this blog post useful for getting setup: Quick Sbt Tutorial

This project is configured to use:

  • Scala 2.10.0
  • ScalaTest 2.0.M5b (current ScalaTest 2.0 beta version)

Quick Setup

  1. Install SBT
  2. Clone this project
  3. Run sbt (This will also download all dependencies)
  4. In the sbt console you can:
  • run - runs the greeter.Hello application
  • test - runs the GreetingsSpec tests
  • console - run the REPL with your project environment loaded
  • compile - compiles. :)
  • clean - cleans the generated file from compiling

IntelliJ Users

I use IntelliJ and I use sbt-idea to generate the Intellij project files. When you have it setup as described in their readme you can run gen-idea in your sbt console to generate the .idea project folders.

Example Console Use

When you run the console in sbt your projects environment is available. For example, you can create an instance of Greetings and access its methods:

> console
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val g = new greeter.Greetings
g: greeter.Greetings = greeter.Greetings@304d03e5

scala> g.greeting
res0: String = It works!

About

Example Scala project using SBT and ScalaTest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages