Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #67

Merged
merged 6 commits into from
Feb 24, 2014
Merged

Add tests #67

merged 6 commits into from
Feb 24, 2014

Conversation

yyuu
Copy link
Contributor

@yyuu yyuu commented Feb 24, 2014

I added tests for sbt-extras with using sstephenson/bats, which is a testing framework for bash projects. Plus, I fixed some potential problems in sbt-extras to pass tests.

  1. Set sbt.global.base for pre-0.13
  2. Skip adding empty string as sbt argument when $log_level == "Info"
  3. Download older releases of sbt-launch.jar if specified
  4. Quote bash variables to avoid unexpected expansion

@yyuu
Copy link
Contributor Author

yyuu commented Feb 24, 2014

You can run the tests with following procedures.

$ git clone https://github.com/sstephenson/bats.git
$ bats/bin/bats ./test
1..68
ok 1 loads .sbt_completion.sh
ok 2 fails to start sbt on empty project
ok 3 starts sbt on empty project if -sbt-create was given
ok 4 downloads sbt 0.7.x
ok 5 downloads sbt 0.10.x
ok 6 downloads sbt 0.11.x (< 0.11.3) from org.scala-tools.sbt:sbt-launch
ok 7 downloads sbt 0.11.x (>= 0.11.3) from org-scala-sbt:sbt-launch
ok 8 downloads sbt 0.12.x
ok 9 downloads sbt 0.13.x
(... snip ...)

@jkleckner
Copy link

+1
I've used this version of sbt along with https://github.com/jkleckner/dotsbt

@paulp
Copy link
Collaborator

paulp commented Feb 24, 2014

This looks awesome. I'll take a test run and let you know.

@paulp
Copy link
Collaborator

paulp commented Feb 24, 2014

@yyuu Do you recall what specifically led you to restoring the code to download older launchers? It's supposed to be the case that the current launcher subsumes all older launchers. I have definitely found that to be untrue myself - so I'm glad to see it back - and launcher/project version mismatch has been fronted as a possible factor in my ongoing battles with .ivy2 corruption, but if there are additional reasons it would assist me to know them.

@paulp paulp mentioned this pull request Feb 24, 2014
@paulp paulp merged commit 0e0fcdb into dwijnand:master Feb 24, 2014
@paulp
Copy link
Collaborator

paulp commented Feb 24, 2014

To have someone send a PR including a bunch of tests is the open source dream. Thanks!

@paulp
Copy link
Collaborator

paulp commented Feb 24, 2014

Also I flipped on travis so you need not if you don't want to.

@yyuu
Copy link
Contributor Author

yyuu commented Feb 25, 2014

@paulp I believe genuine sbt-launch.jar of older releases have 100% compatibility with themselves, even if sbt 0.13.x claims that it subsumes their functionality. Just using older sbt is the easiest way for me to build older sbt based projects.

@paulp
Copy link
Collaborator

paulp commented Feb 25, 2014

I believe genuine sbt-launch.jar of older releases have 100% compatibility with themselves

Wise words.

@yyuu yyuu deleted the add-bats-test branch February 27, 2014 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants