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

Conversation

Projects
None yet
3 participants
@yyuu
Contributor

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

jkleckner commented Feb 24, 2014

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

@paulp

This comment has been minimized.

Owner

paulp commented Feb 24, 2014

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

@paulp

This comment has been minimized.

Owner

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 referenced this pull request Feb 24, 2014

Merged

Add test runner. #68

@paulp paulp merged commit 0e0fcdb into paulp:master Feb 24, 2014

@paulp

This comment has been minimized.

Owner

paulp commented Feb 24, 2014

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

@paulp

This comment has been minimized.

Owner

paulp commented Feb 24, 2014

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

@yyuu

This comment has been minimized.

Contributor

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

This comment has been minimized.

Owner

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 yyuu:add-bats-test branch Feb 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment