I've spent 30 minutes on it and haven't gotten any...
# spek
s
I've spent 30 minutes on it and haven't gotten anywhere.
r
Can you share your current progress? (Build scripts, structure, etc..)
s
literally copied and pasted from the spek framework website. I had to add the url to specify the maven repo since the website also has that wrong. Oh and the website doesn't have kotlin dsl so I had to figure that out. I have pushed a repo showing my progress. https://github.com/snowe2010/pretty-print
biggest issues so far: couldn't find which version of spek2 to pull. Couldn't find where the actual spek2 maven repo was (not maven central). Can't figure out what classes I need to import to actually use spek
current problem is that I have no clue what to import to get the function
it
to be resolvable. I thought it was
import <http://org.spekframework.spek2.style.specification.Suite.it|org.spekframework.spek2.style.specification.Suite.it>
, but intellij refuses to resolve that as an actual method.
r
The latest version of spek is
2.0.0-rc.1
. I've cloned your project and noticed you're using the dsl wrong. You can't use
it
with
group
- you either use the whole specification style or use
test
instead of
it
.
Copy code
package com.tylerthrailkill.helpers.prettyprint

import org.spekframework.spek2.Spek

object MyTest: Spek({
    println("this is the root")
    group("some group") {
        println("some group")
        test("some test") {
            println("some test")
        }
    }

    group("another group") {
        println("another group")
        test("another test") {
            println("another test")
        }
    }
})
or this:
Copy code
package com.tylerthrailkill.helpers.prettyprint

import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe

object MyTest: Spek({
    println("this is the root")
    describe("some group") {
        println("some group")
        it("some test") {
            println("some test")
        }
    }

    describe("another group") {
        println("another group")
        it("another test") {
            println("another test")
        }
    }
})
I suggest you read this page first: https://spekframework.org/core-concepts/ before writing any tests.
Docs about the specification style can be found here: https://spekframework.org/specification/
Another style is `gherkin`: https://spekframework.org/gherkin/
s
1.
2.0.0-rc.1
isn’t an artifact in that repo. https://dl.bintray.com/spekframework/spek-dev/org/spekframework/spek2/spek-dsl-jvm/ 2. I’ve read the core concepts and understand them. there is a lack of proper examples for working with spek, both in the repo and on the webpage. I’ve resorted to looking for other instructions around the internet in order to fill in these gaps. I’m guessing the example I copied was from an earlier rc of 2 then…
I’ll try out this stuff when I get home tonight, we’ve had a lot of stuff happening at my work in the last two days.
r
s
then the website is completely wrong.
it says to use dsl-jvm
Copy code
testImplementation ('org.spekframework.spek2:spek-dsl-jvm:${spek_version}')  {
and the maven section lists the url as
<https://dl.bintray.com/spekframework/spek-dev>
as does this issue. https://github.com/spekframework/spek/issues/461