buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Boisvert" <>
Subject Re: Problems with specs
Date Fri, 12 Sep 2008 22:06:01 GMT
Yes, the ScalaTest module needs to be monkey-patched early to add JUnit due
to the way the test framework classes are loaded during bootstrap.

There were was a discussion about making this cleaner in 1.3:

but I don't know if anything came out of it.


On Fri, Sep 12, 2008 at 2:17 PM, Joakim Ohlrogge <
> wrote:

> Hi all,
> I am new to builder and am in a bit of trouble. I am trying scala
> specs in buildr 1.3.2 and it works fine until I want to make the spec
> runnable with JUnit.
> When I add
> class PublishSiteGraphSpecTest extends JUnit4(PublishSiteGraphSpec)
> To my spec I get:
> NoClassDefFoundError: junit/framework/Test
> rake aborted!
> junit/framework/Test
> from buildr.
> I tried to add junit to test.with but it didn't work. I figured out
> that my problem was related to the class-path of ScalaTest in
> test_framework.rb and by adding JUnit::REQUIRES to the present list of
> requirements, like this:
>      # ScalaTest dependencies
>      DEPENDS = ["org.scalatest:scalatest:jar:#{VERSION}"] +
>                 JMock::REQUIRES +
>                 ScalaSpecs::REQUIRES +
>                 ScalaCheck::REQUIRES +
>                 JUnit::REQUIRES
> It works.
> I bet there is a better way, I tried to open the class in ~/buildr.rb
> and change the constant but I just get warnings that I'm trying to
> change it. I also noticed that the buildr.rb is not picked up if I put
> it in the same directory as my buildfile (the homepage says that
> buildr will look for a buildr.rb in the build-directory and I assumed
> that the build-directory is the same as the directory with the
> buildfile?)
> What is the best way to make this kind of patches? I would really like
> to be able to make these changes by just checking in a buildr.rb
> together with my buildfile or something comparably easy. Especially
> since I noticed that you have to be root to change gem-files in
> ubuntu.
> I'm probably overlooking something simple and I can't seem to make
> google dig up the correct information for me so I thought I'd ask
> here.
> Best regards!
> /Joakim Ohlrogge

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message