etorreborre / specs Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/specs
License: Other
Automatically exported from code.google.com/p/specs
License: Other
================================== DEPRECATED!!! This project is just kept here for historical reasons after the shutdown of the original site at https://code.google.com/p/specs. The specs library has been replaced by [specs2](http://github.com/etorreborre/specs2). ================================== ------------------------- Installation instructions ------------------------- You need to download and install Maven 2.0.9. Then execute the following command: > mvn install This will download the necessary dependent jars, build specs-<VERSION>.jar and install it in your local repository (you can also get the built jar in the target directory created by Maven at the root of your specs checkout). For more instructions about using specs and its dependencies, please refer to the website: http://code.google.com/p/specs/wiki/RunningSpecs Thanks! Eric.
I apologize for my insufficient explanation.
(My ability at English is insufficient. )
Other file names for which some the corrections are necessary seem to exist.
specs-tests-1.2.1.jar -> specs-1.2.1-tests.jar
hamcrest-1.1.jar -> hamcrest-all-1.1.jar
I wish to express my gratitude for your having made wonderful software.
regards.
Original issue reported on code.google.com by [email protected]
on 27 Jan 2008 at 12:54
What steps will reproduce the problem?
1. scala -classpath path/to/specs-1.3.1.jar
2. import org.specs._
3. object Test extends Specification { "max == max" in { Integer.MAX_VALUE
mustBe Integer.MAX_VALUE } }
4. Test.main(new Array[String](0))
What is the expected output? What do you see instead?
true
false
What version of the product are you using? On what operating system?
1.3.1, Scala 2.7.2.RC1, Asus EEE edition of Linux.
Please provide any additional information below.
A very manual binary search revealed that 1024 mustBe 1024 works, and 1025
mustBe 1025 doesn't - not coincidentally 1024.asInstanceOf[AnyRef] eq
1024.asInstanceOf[AnyRef] but the opposite is true for 1025.
I used mustBe because that's what was showed on the home page for the
project. From reading the source I see that I should be using mustEqual,
but it seems to me that mustBe is so fragile, thanks to 'eq''s interaction
with Ints, etc., that mustEqual should be suggested instead in the
documentation.
Original issue reported on code.google.com by [email protected]
on 21 Sep 2008 at 12:01
What steps will reproduce the problem?
$> cat myTest.scala
import org.specs._
object mySpec extends Specification {
"my world" should {
"be free of evil" >> {
"giving peace" >> {false must beTrue}
"giving prosperity" >> {true must beTrue}
}
}
}
mySpec.main(args)
$> scala -cp ~/Download/specs-1.4.1.jar myTest.scala
Specification "mySpec"
my world should
x be free of evil
the value is false ((virtual file):10)
x giving peace
the value is false ((virtual file):10)
+ giving prosperity
Total for specification "mySpec":
Finished in 0 second, 49 ms
2 examples, 2 expectations, 2 failures, 0 error
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Specs 1.4.1
Scala 2.7.2
Please provide any additional information below.
I have not switched to Specs 1.4.2 and Scala 2.7.3 because of limited
bandwidth. If this issues has been fixed in the newer versions, it can be
ignored.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2009 at 10:43
Like this:
===
object DbTests extends Specification("Database tests") { ... }
===
(current syntax with default test name should be allowed too)
Original issue reported on code.google.com by [email protected]
on 13 May 2008 at 11:29
What steps will reproduce the problem?
I've tried to use Scalacheck matchers and faced some strange compilator error.
Assume compilation of the following class:
import org.specs._
import org.specs.Scalacheck
object CommandParserSpec extends Specification with Scalacheck{}
It gives me an error:
[fsc] java.lang.RuntimeException: malformed Scala signature of
ScalacheckFunctions at 731; reference type Stats of object Test refers to
nonexisting symbol.
[fsc] at
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.
scala:755)
[fsc] at
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.scala$tools$nsc$symtab$class
file$UnPickler$UnPickle$$readSymbol(UnPickler.scala:172)
What is the expected output? What do you see instead?
Compilation succeeds.
What version of the product are you using? On what operating system?
1.3.1, Linux
Please provide any additional information below.
Error appears after adding 'with Scalacheck'.
Original issue reported on code.google.com by [email protected]
on 19 Aug 2008 at 10:10
What steps will reproduce the problem?
1. Create this spec:
object Foo extends Specification {
<foo>
<a id="1" />
<a id="2" />
</foo> must ==/(
<foo>
<a id="2" />
<a id="1" />
</foo>
)
}
What is the expected output? What do you see instead?
The match should be ok but it isn't
What version of the product are you using? On what operating system?
1.3.1
Original issue reported on code.google.com by [email protected]
on 17 Sep 2008 at 4:47
In http://code.google.com/p/specs/wiki/MatchersGuide, the matcher
haveTheSameElementsAs is incorrectly named. It should read haveSameElementsAs.
Original issue reported on code.google.com by [email protected]
on 26 Jan 2008 at 1:50
List(1, "string") must contain("string")
does not compile:
[scalac] found : org.specs.matcher.Matcher[Iterable[java.lang.String]]
[scalac] required: org.specs.matcher.Matcher[Iterable[Any]]
[scalac] List(1, "string") must contain("string")
Workaround is
List(1, "string") must contain("string": Any)
Original issue reported on code.google.com by [email protected]
on 11 May 2008 at 8:37
What steps will reproduce the problem?
1. Create a test class that extends JUnit3
2. Create a spec with two "should" clauses
3. Create a "in" clause with the same name in each "should" clause
4. Run the test in a JUnit4 runner.
Example:
class ExampleTest extends JUnit3(ExampleSpec)
object ExampleSpec extends Specification {
"foo" should {
"bar" in {
1 must be_==(1)
}
}
"other" should {
"bar" in {
2 must be_==(2)
}
}
}
What is the expected output? What do you see instead?
I expect to see two tests pass under ExampleSpec in the JUnit runner.
Instead, only one passes while the indication for the other doesn't change
(as if it did not run). I will attach a screenshot.
Note that changing one "bar" to "otherbar" or anything else makes it work
again.
What version of the product are you using? On what operating system?
Using version 1.2.2 with the Eclipse JUnit4 runner.
Original issue reported on code.google.com by ismaelj
on 6 Feb 2008 at 9:05
Attachments:
The doBefore and doAfter code is not executed for sub-examples when there
are additional systems. A simple test:
object BeforeAfterSpecification extends Specification {
"the testing system" should {
var i = 0
doBefore{ i += 1 }
doAfter{ i -= 1 }
"call doBefore/doAfter for examples" in {
i mustBe 1
"including sub-examples" in {
i mustBe 1
}
}
}
// Remove this system and the above tests will succeed.
"some other system" should {
"do something" in {
}
}
}
Original issue reported on code.google.com by [email protected]
on 26 Aug 2008 at 11:32
I'd like to group tests as in scalax.testing:
===
object IntTests ...
object StringTests ...
object AllTests extends Specification {
include(IntTests)
include(StringTests)
}
===
it is easier syntax then
===
"all tests" isSpecifiedBy(
IntTests, StringTests)
===
Original issue reported on code.google.com by [email protected]
on 7 May 2008 at 1:48
Please add beEmpty matcher:
List() must beEmpty
it should be equivalent to
List() must haveSize(0)
Original issue reported on code.google.com by [email protected]
on 27 Jul 2008 at 8:48
What steps will reproduce the problem?
Execute a test in a JUnit4 runner with Scala 2.7.0-rc1.
What is the expected output? What do you see instead?
Test should run to completion. Instead the following happens:
java.lang.NoSuchMethodError: scala.runtime.RichInt.to(I)Lscala/Range;
at
org.specs.runner.JUnit38SuiteRunner.makeDescription(JUnit38SuiteRunner.scala:52)
at
org.specs.runner.JUnit38SuiteRunner.getDescription(JUnit38SuiteRunner.scala:37)
What version of the product are you using? On what operating system?
Specs 1.3.0-SNAPSHOT as of a few minutes ago and Scala 2.7.0-rc1. Note that
the latter is available from the scala-tools.org maven repo so should be
easy to test
Please provide any additional information below.
I am not sure if this is a specs or scala bug, so please let me know if
it's the latter so that we can move it to the Scala tracker.
Original issue reported on code.google.com by ismaelj
on 9 Feb 2008 at 2:06
I try to make Patch
-----Specsfinder.scala
:
while (m.find) {
if (packageName(filePath) == "")
result += (m.group(1).trim + "$")
else
result += ((packageName(filePath) + "." + m.group(1).trim) + "$")
}
:
-----
But, I can't test that code.
Please examine it.
Original issue reported on code.google.com by [email protected]
on 26 Jan 2008 at 5:07
What steps will reproduce the problem?
Run the following Specification.
object SpecsSpec extends Specification {
"specs" should {
"evaluate a code block only once" in {
var invoked = 0
def function = {
invoked += 1
assume(invoked == 1)
invoked
}
1 must be_==(function)
}
}
}
What is the expected output? What do you see instead?
I expect the test to pass, but it fails with the following exception:
java.lang.AssertionError: assumption failed
at scala.Predef$.assume(Predef.scala:97)
at specs.SpecsSpec$$anonfun$1$$anonfun$apply$1.function$1(SpecsTest.scala:15)
at
specs.SpecsSpec$$anonfun$1$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.ap
ply(SpecsTest.scala:18)
at
specs.SpecsSpec$$anonfun$1$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.ap
ply(SpecsTest.scala:18)
at org.specs.matcher.AnyMatchers$$anon$3.apply(AnyMatchers.scala:41)
at org.specs.specification.Assertable$class.applyMatcher(Assert.scala:8)
at org.specs.specification.Assert.applyMatcher(Assert.scala:23)
at org.specs.specification.Assert.must(Assert.scala:28)
at specs.SpecsSpec$$anonfun$1$$anonfun$apply$1.apply(SpecsTest.scala:18)
at specs.SpecsSpec$$anonfun$1$$anonfun$apply$1.apply(SpecsTest.scala:11)
at
org.specs.specification.ExampleLifeCycle$class.executeTest(SpecificationStructur
e.scala:142)
at org.specs.Specification.executeTest(Specs.scala:24)
at org.specs.Sut.executeTest(Specs.scala:173)
at org.specs.Example$$anonfun$in$1.apply(Specs.scala:255)
at org.specs.Example$$anonfun$in$1.apply(Specs.scala:242)
at org.specs.Example.execute(Specs.scala:277)
at org.specs.Example.subExamples(Specs.scala:232)
at
org.specs.runner.ExamplesTestSuite$$anonfun$initialize$2.apply(JUnit.scala:115)
at
org.specs.runner.ExamplesTestSuite$$anonfun$initialize$2.apply(JUnit.scala:114)
at scala.Iterator$class.foreach(Iterator.scala:395)
at
scala.collection.mutable.SingleLinkedList$$anon$1.foreach(SingleLinkedList.scala
:50)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.collection.mutable.Queue.foreach(Queue.scala:24)
at org.specs.runner.ExamplesTestSuite.initialize(JUnit.scala:114)
at org.specs.runner.JUnitSuite$class.init(JUnit.scala:31)
at org.specs.runner.ExamplesTestSuite.init(JUnit.scala:107)
at org.specs.runner.JUnitSuite$class.getName(JUnit.scala:40)
at org.specs.runner.ExamplesTestSuite.getName(JUnit.scala:107)
at
org.specs.runner.TestDescription$class.asDescription(JUnitSuiteRunner.scala:79)
at org.specs.runner.JUnitSuiteRunner.asDescription(JUnitSuiteRunner.scala:13)
at
org.specs.runner.TestDescription$class.makeDescription(JUnitSuiteRunner.scala:87
)
at
org.specs.runner.JUnitSuiteRunner.makeDescription(JUnitSuiteRunner.scala:13)
at
org.specs.runner.TestDescription$$anonfun$makeDescription$1.apply(JUnitSuiteRunn
er.scala:89)
at
org.specs.runner.TestDescription$$anonfun$makeDescription$1.apply(JUnitSuiteRunn
er.scala:88)
at scala.List.foreach(List.scala:827)
at
org.specs.runner.TestDescription$class.makeDescription(JUnitSuiteRunner.scala:88
)
at
org.specs.runner.JUnitSuiteRunner.makeDescription(JUnitSuiteRunner.scala:13)
at org.specs.runner.JUnitSuiteRunner.getDescription(JUnitSuiteRunner.scala:37)
at
org.junit.internal.runners.CompositeRunner.getDescription(CompositeRunner.java:4
0)
at org.junit.runner.Runner.testCount(Runner.java:38)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.countTestCases(J
Unit4TestClassReference.java:29)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.countTests(RemoteTestRunn
er.java:480)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:448)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)
What version of the product are you using? On what operating system?
I am running the specs snapshot from Maven from today (02/05/2008).
Please provide any additional information below.
There was a test in my application that started failing this morning
because of this, which would suggest that the regression was introduced
recently. I don't see any commits on SVN though. Is it possible that a new
snapshot was submitted to the repo without committing the changes to SVN?
Btw, I am running the snapshot because I am using Scala 2.7.1-rc2.
Original issue reported on code.google.com by ismaelj
on 2 May 2008 at 1:43
What steps will reproduce the problem?
1. mvn clean install from svn checkout revision 227
What is the expected output?
Expected successful compilation and installation.
What do you see instead?
[INFO] [scala:testCompile {execution: default}]
[INFO] Compiling 60 source files to
/home/ijuma/src/specs-read-only/target/test-classes
[WARNING]
/home/ijuma/src/specs-read-only/src/test/scala/org/specs/mock/jmockSpec.scala:22
8:
error: BadMocked is already defined as trait BadMocked
[WARNING] trait BadMocked extends Mocked {
[WARNING] ^
[WARNING]
/home/ijuma/src/specs-read-only/src/test/scala/org/specs/mock/jmockSpec.scala:24
4:
error: Mocked is already defined as trait Mocked
[WARNING] trait Mocked extends Specification with JMocker with
ExampleLifeCycle with ClassMocker {
[WARNING] ^
[WARNING] two errors found
What version of the product are you using? On what operating system?
revision 227, scala compiler 2.6.1, Fedora 8, JDK 6u4
Original issue reported on code.google.com by ismaelj
on 22 Jan 2008 at 5:25
Please add no-arg fail() method.
Original issue reported on code.google.com by [email protected]
on 19 May 2008 at 7:47
Because fail method has side effect.
Original issue reported on code.google.com by [email protected]
on 1 Aug 2008 at 8:46
Output.printStackTrace should go to the Output itself by default
Attached patch makes printStackTrace to print to the Output. Works on Sun
JDK, but not guaranteed to work on any JDK implementation (other JDKs
allowed to call other PrintWriter methods then print(String))
Original issue reported on code.google.com by [email protected]
on 6 Aug 2008 at 9:57
Attachments:
(not as downloadable archive, but as browsable HTML). Probably, it can be
hosted on scala-tools.org or scalaforge.org.
Original issue reported on code.google.com by [email protected]
on 10 May 2008 at 4:11
Cannot build specs
mvn install
produces output:
===
[INFO] Scanning for projects...
WAGON_VERSION: 1.0-beta-2
[INFO] ------------------------------------------------------------------------
[INFO] Building specs
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading:
http://scala-tools.org/repo-snapshots/org/scala-tools/maven-scala-plugin/2.8-SNA
PSHOT/maven-scala-plugin-2.8-SNAPSHOT.pom
Downloading:
http://scala-tools.org/repo-releases/org/scala-tools/maven-scala-plugin/2.8-SNAP
SHOT/maven-scala-plugin-2.8-SNAPSHOT.jar
Downloading:
http://scala-tools.org/repo-snapshots/org/scala-tools/maven-scala-plugin/2.8-SNA
PSHOT/maven-scala-plugin-2.8-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check
that the goal name is correct: Unable to download the artifact from any
repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.scala-tools
-DartifactId=maven-scala-plugin -Dversion=2.8-SNAPSHOT
-Dpackaging=maven-plugin -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.scala-tools
-DartifactId=maven-scala-plugin -Dversion=2.8-SNAPSHOT
-Dpackaging=maven-plugin -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
org.scala-tools:maven-scala-plugin:maven-plugin:2.8-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
scala-tools.org (http://scala-tools.org/repo-releases),
scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots)
org.scala-tools:maven-scala-plugin:maven-plugin:2.8-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
scala-tools.org (http://scala-tools.org/repo-releases),
scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Nov 03 19:41:42 MSK 2008
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
===
It looks for maven-scala-plugin version 2.8-SNAPSHOT, but there is no such
file in the scala-tools repository.
Original issue reported on code.google.com by [email protected]
on 3 Nov 2008 at 4:42
I need matcher that checks collection length. Currently it is possible to
write:
===
collection.length must_== 2
===
but it does not print what collection has wrong size.
===
collection must beLike { case s: Seq[_] => s.length == 2 }
===
does not print length, and it is too long declaration.
I'd like to have something like:
===
collection must haveLength(2)
===
Probably, this feature is useless for the most specs users.
Original issue reported on code.google.com by [email protected]
on 13 May 2008 at 11:44
It would be nice to have a matcher that compared XML nodes but ignored
whitespace.
I am at present too lazy to code it myself, but I'll try to do so when I have
spare cycles.
Original issue reported on code.google.com by [email protected]
on 12 May 2008 at 9:58
greater already means "strictly greater". Current names confuse test readers.
beGreaterThen must be >
beNotLessThen must be >=
beLessThen must be <
beNotGreaterThen must be <=
Anyway, probably better names for methods are:
beGt(x)
beGe(x) -- greater or equal
beLt(x)
beLe(x)
Original issue reported on code.google.com by [email protected]
on 3 Oct 2008 at 3:32
The throw* methods in AnyMatchers are:
def throwAnException[E <: Throwable](implicit m: Manifest[E])
def throwA[E <: Throwable](implicit m: Manifest[E])
def throwAn[E <: Throwable](implicit m: Manifest[E])
def throwThis[E <: Throwable](exception: =>E)
def throwException[E <: Throwable](exception: =>E)
This is confusing because the documentation[1] implies that they are all
aliases while in reality some of them take an instance of an exception
while others rely on implicit manifests. (e.g. when I upgraded to specs
1.4.0, I got a bunch of compiler errors because passing an instance of an
exception does not work when calling throwA).
I also got a compiler error for something similar to the following example
in the documentation:
"a must haveClass(c) is ok if a.getClass == c".
Using manifests here can lead to nicer code in some cases, but it's not a
replacement for the case where one has two instances and wants to compare
the classes of both.
[1]
http://code.google.com/p/specs/wiki/MatchersGuide#If_you_want_to_verify_that_an_
exception_is_thrown
Original issue reported on code.google.com by ismaelj
on 25 Nov 2008 at 7:05
Using specs 1.2.6. ConsoleRunner outputs:
===
]% scala -classpath '.:*' ARunner
Specification "A"
cool program should
x save the world
'ba' doesn't start with 'a' (hello.scala:7)
Total for specification "A":
Finished in 0 second, 218 ms
1 example, 1 assertion, 1 failure, 0 error
]% echo $?
0
===
There are failures, but exit code of runner is 0.
Original issue reported on code.google.com by [email protected]
on 7 May 2008 at 1:23
What steps will reproduce the problem?
Example spec:
object ThrowExceptionSpec extends Specification {
def methodWithMapResult: Map[String, String] = throw new
IllegalArgumentException
def methodWithBooleanResult: Boolean = throw new IllegalArgumentException
"exceptions thrown should be handled" should {
"tested method result is Boolean" in {
methodWithBooleanResult must throwA(new IllegalArgumentException)
}
"tested method result is Map" in {
methodWithMapResult must throwA(new IllegalArgumentException)
}
}
}
What is the expected output? What do you see instead?
I expect both tests to pass, but only the first one does.
The test that fails gives the following output:
tested method result is Map(org.specs.runner.ExampleTestCase) Time
elapsed: 0.003 sec <<< FAILURE!
java.lang.IllegalArgumentException
at
test.ThrowExceptionSpec$.methodWithMapResult(ThrowExceptionTest.scala:10)
at
test.ThrowExceptionSpec$$anonfun$1$$anonfun$apply$4.apply(ThrowExceptionTest.sca
la:19)
at
test.ThrowExceptionSpec$$anonfun$1$$anonfun$apply$4.apply(ThrowExceptionTest.sca
la:19)
at
org.specs.specification.ExampleLifeCycle$class.executeTest(SpecificationStructur
e.scala:130)
at org.specs.Specification.executeTest(Specs.scala:24)
at org.specs.Sut.executeTest(Specs.scala:151)
at org.specs.Example.in(Specs.scala:219)
at
test.ThrowExceptionSpec$$anonfun$1.apply(ThrowExceptionTest.scala:18)
at
test.ThrowExceptionSpec$$anonfun$1.apply(ThrowExceptionTest.scala:14)
at org.specs.Sut.should(Specs.scala:107)
at test.ThrowExceptionSpec$.<init>(ThrowExceptionTest.scala:14)
at test.ThrowExceptionSpec$.<clinit>(ThrowExceptionTest.scala)
at test.ThrowExceptionTest.<init>(ThrowExceptionTest.scala:6)
What version of the product are you using? On what operating system?
specs 1.2.2
Original issue reported on code.google.com by ismaelj
on 8 Feb 2008 at 7:03
specs.org domain does not belong to specs authors. This confuses source
code readers: they find "import org.specs._" declarations, then open
browser, navigate to http://specs.org/ and find cybersquatted domain with ads.
Package may be called com.googlecode.specs
Original issue reported on code.google.com by [email protected]
on 7 May 2008 at 1:16
What steps will reproduce the problem?
1. get the 1.4 branch or trunk
2. mvn install
What is the expected output? What do you see instead?
i get this error on both trunk and 1.4 attached is the output running debug:
[WARNING]
/Users/sbendiola/libs/specs/SPECS-1.4.0/src/main/scala/org/specs/runner/JUnit.sc
ala:49:
error: type mismatch;
[WARNING] found : List[?0] where type ?0
[WARNING] required: List[junit.framework.Test]
[WARNING] def tests: List[Test] = {init; enumerationToList(testSuite.tests)}
[WARNING] ^
[WARNING] one error found
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] command line returned non-zero value:1
[INFO] ------------------------------------------------------------------------
[INFO] Trace
What version of the product are you using? On what operating system?
1.4.0 on osx tiger
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 26 Nov 2008 at 2:47
Attachments:
What steps will reproduce the problem?
1. Scalacheck 1.2
2. Specs 1.2.5
3. Specification such as the one below:
object listSpec extends Specification {
"Simple ScalaCheck example" should {
"have single-item lists" in {
val listsWithOneInt = for(
x <- arbitrary[Int]
) yield List(x)
listsWithOneInt must pass { x: List[Int] =>
x.length must be(1)
}
}
}
}
What is the expected output? What do you see instead?
Expect it to compile and pass.
Running with maven, I instead get:
java.lang.NoSuchMethodError: scala.Symbol.intern()Lscala/Symbol;
at org.specs.matcher.ScalacheckParameters$class.$init$(ScalacheckMatchers.scala:132)
at org.specs.matcher.ScalacheckParameters$.<init>(ScalacheckMatchers.scala:198)
at org.specs.matcher.ScalacheckParameters$.<clinit>(ScalacheckMatchers.scala)
at
org.specs.matcher.ScalacheckMatchers$class.defaultParameters(ScalacheckMatchers.
scala:20)
at org.specs.Specification.defaultParameters(Specs.scala:24)
....
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 9 Apr 2008 at 5:38
What steps will reproduce the problem?
1. import java.util.Arrays.asList
2. Write a Specification that uses asList
3. Try running it.
What is the expected output? What do you see instead?
I expect the code to use Arrays.asList. Instead I get odd errors about
Vector because of JavaCollectionsConversion.asList being inherited as part
of Specification.
What version of the product are you using? On what operating system?
1.4.1. Linux.
Please provide any additional information below.
I'd suggest renaming it to something like vector2List.
Original issue reported on code.google.com by [email protected]
on 27 Dec 2008 at 2:49
What steps will reproduce the problem?
1. Write erroneous specification of form:
"My Thing" should {
"do something" {
...possibly long setup...
...
something must ... other // matcher
}
}
2. Compile
What is the expected output? What do you see instead?
The error message ends up down at the end of the matcher, with
error: type mismatch;
[WARNING] found : Boolean
[WARNING] required: Int
It's more food for thought than a bug or enhancement request, but it would be
nice if we could
work out a more diagnostic error message...
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 12 May 2008 at 8:01
What steps will reproduce the problem?
1.
import org.specs.runner.JUnit4
import org.specs.{Specification, Scalacheck}
class SecondTest extends JUnit4(new Specification with Scalacheck {
"foo" should { "equal foo" in { "foo" mustBe "bar" } } } )
2. Run the above with JUnit.
3. Look at the report.
What is the expected output? What do you see instead?
"foo should equal foo: foo should equal bar"
"equal foo"
What version of the product are you using? On what operating system?
Specs 1.3.1.
Scala 2.7.1, Java 6, Ubuntu Hardy.
Please provide any additional information below.
I'm using Maven to run it.
Original issue reported on code.google.com by [email protected]
on 19 Sep 2008 at 2:30
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Jun 2008 at 11:26
What steps will reproduce the problem?
1. Check out from svn into a scala project
2. IDE highlights unknown classes
3. scala.util.ExtendedIterable, scala.io.ConsoleOutput,
scala.io.FileSystem, scala.util.JavaCollectionsConversion not resolved
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
trunk
Please provide any additional information below.
Not sure if these classes are supposed to be in 2.6 final. Would it be
possible to change the root package from "scala.specs" to just specs to
prevent confusion?
Thanks,
Steve
Original issue reported on code.google.com by [email protected]
on 4 Oct 2007 at 4:33
In the manual section about "Literal specifications", I think you mean
"Literate."
"Literal" suggests some kind of explicit encoding of a specification as a
value, by analogy to "string
literal" or "function literal."
"Literate" suggests wordy and eloquent; it is also the term used for "Literate
Haskell" and "Literate
Programming."
cheers!
~aaron
Original issue reported on code.google.com by [email protected]
on 10 Jul 2008 at 9:12
{{{
Index: src/main/scala/org/specs/runner/Reporter.scala
===================================================================
--- src/main/scala/org/specs/runner/Reporter.scala (revision 757)
+++ src/main/scala/org/specs/runner/Reporter.scala (working copy)
@@ -55,7 +55,7 @@
* Then it calls the reportSpecs method and exit the System with the
appropriate error code,
* depending on the specification success or not.
*/
- def main(arguments: Array[java.lang.String]) = {
+ def main(arguments: Array[String]) = {
if (arguments != null)
args = args ++ arguments
reportSpecs
}}}
Otherwise scalac output is confusing: it could output both java.lang.String
and String in same error message. (I've discovered it while tested #34)
Original issue reported on code.google.com by [email protected]
on 9 Jan 2009 at 3:13
From the documentation I get the impression that specs works with any JUnit
4 version, but using specs with JUnit < 4.4, which is what is bundled with
Eclipse and NetBeans, gives the error below. A notice on the wiki (and a
useful error message) that 4.4 is required would be nice.
java.lang.NoSuchMethodError:
org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;[Ljava/lan
g/annotation/Annotation;)Lorg/junit/runner/Description;
at
org.specs.runner.TestDescription$class.asDescription(JUnitSuiteRunner.scala:79)
at org.specs.runner.JUnitSuiteRunner.asDescription(JUnitSuiteRunner.scala:13)
at
org.specs.runner.TestDescription$class.makeDescription(JUnitSuiteRunner.scala:87
)
at
org.specs.runner.JUnitSuiteRunner.makeDescription(JUnitSuiteRunner.scala:13)
at org.specs.runner.JUnitSuiteRunner.getDescription(JUnitSuiteRunner.scala:37)
at org.junit.runner.Runner.testCount(Runner.java:38)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.countTestCases(J
Unit4TestClassReference.java:29)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.countTests(RemoteTestRunn
er.java:480)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:448)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)
Original issue reported on code.google.com by [email protected]
on 25 Aug 2008 at 8:08
Hi,
specs looks like an interesting test framework and the fact that JUnit
runners still work is great.
It would be nice if the sources were included in the maven repository so
that IDE users can easily look at the framework code. It's a small change
in the pom as can be seen here[1]. Thanks in advance.
[1] http://maven.apache.org/plugins/maven-source-plugin/usage.html
Original issue reported on code.google.com by ismaelj
on 22 Jan 2008 at 3:41
What steps will reproduce the problem?
1. Implemented the example from
http://code.google.com/p/specs/wiki/QuickStart with scala2.6.1-final and
specs-1.2.3
2. Got this exception when trying to compile the exaple scala file.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Specs-1.2.3 on Linux
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 13 Feb 2008 at 7:51
AFAIU, there is no way currently to check whether two seqs have same
elements in same order (except with beLike). So please add
haveSameElementsInSameOrderAs matcher.
Original issue reported on code.google.com by [email protected]
on 10 May 2008 at 5:04
I've created custom runner for specs (attached). It runs test and produces
output parseable by TeamCity:
http://www.jetbrains.net/confluence/display/TCD3/Build+Script+Interaction+with+T
eamCity
Please, consider inclusion into the specs source.
Screenshots:
http://screencast.com/t/OpSg3PkcqCZ
http://screencast.com/t/6it9oqcXJ
"message" parameter of "testFailed" message is ignored by TeamCity, I
believe it is a bug of TeamCity.
Original issue reported on code.google.com by [email protected]
on 6 Aug 2008 at 10:22
Attachments:
abstract class Specification should define main method:
def main(args: Array[String]) = new ConsoleRunner(this).main(args)
to run hello world easier.
===
object SomeSpec extends Specification { ... }
===
I. e. to avoid the need of declaring test runner explicitly.
# scala -classpath ... SomeSpec
Original issue reported on code.google.com by [email protected]
on 7 May 2008 at 1:09
What steps will reproduce the problem?
1. Download sources by either maven or manually from downloads on this site
2. Examine downloaded jar file content
What is the expected output? What do you see instead?
Expected - File Specification.scala in package org.specs Instead found
Specification.scala in org.specs.specification
What version of the product are you using? On what operating system?
1.4.0 on Windows XP
Please provide any additional information below.
I'm not very familiar yet with scala, and probably it is allowed for a file
to reside in different directory structure than package it is declared in,
but at least in is very inconvenient from the point of Eclipse not able to
attach sources correctly
Original issue reported on code.google.com by [email protected]
on 23 Nov 2008 at 12:46
Please, provide README file with build instructions for those who are not
familiar with Maven.
Original issue reported on code.google.com by [email protected]
on 3 Nov 2008 at 4:43
"specs matchers" should {
"work as advertised" in {
List(1, List(2, 3, List(4)), 5) must haveSameElementsAs(List(5, List(List(4), 2, 3), 1))
}
}
fails. MatchersGuide wiki page documents the Matcher to be ignorant of ordering
and do recursive
matching for contained iterables and this does not happen.
This is a Scala issue, I believe:
https://lampsvn.epfl.ch/trac/scala/ticket/888. Matcher relies on
Iterable.sameElements being more powerful than it is.
Original issue reported on code.google.com by [email protected]
on 4 Jun 2008 at 11:32
----- NG
java -cp
specs-1.2.1.jar;specs-tests-1.2.1.jar;scalacheck-1.1.1.jar;scala-library-2.6.1.j
ar;junit-4.4.jar;cglib-2.1_3.jar;asm-1.5.3.jar;objenesis-1.1.jar;hamcrest-1.1.ja
r;jmock-2.4.0.jar
org.specs.allRunner
-----
----- OK
java -cp
specs-1.2.1.jar;specs-1.2.1-tests.jar;scalacheck-1.1.1.jar;scala-library-2.6.1.j
ar;junit-4.4.jar;cglib-2.1_3.jar;asm-1.3.5.jar;objenesis-1.1.jar;hamcrest-all-1.
1.jar;jmock-2.4.0.jar
org.specs.allRunner
-----
Original issue reported on code.google.com by [email protected]
on 26 Jan 2008 at 4:58
What steps will reproduce the problem?
1. Run a class that extends JUnit3 in a CompositeRunner
What is the expected output?
test.OntoEntityTest
OntoEntitySpec
OntoEntity should
output its code in toString
What do you see instead?
junit.framework.TestSuite
junit.framework.TestSuite
junit.framework.TestSuite
output its code in toString
Note that it works fine under the SpecsJUnitRunner.
What version of the product are you using? On what operating system?
specs 1.1.5, Scala 2.6.1, Fedora 8, JDK 6u4
Please provide any additional information below.
I was able to fix this by making a change in makeDescription so that it
does the same as JUnit38ClassRunner from JUnit 4.4. It's not clear why
JUnit38SuiteRunner tried to do something different here. Patch attached.
Original issue reported on code.google.com by ismaelj
on 22 Jan 2008 at 5:36
Attachments:
What steps will reproduce the problem?
Create a composite specification composed of 2 specifications taking a time
to execute > 0 ms.
What is the expected output? What do you see instead?
The total time should be the sum of the time taken for the 2 specifications
but that value seems to be discarded.
Original issue reported on code.google.com by [email protected]
on 14 Jan 2009 at 2:25
I've written test, it uses some code that throws IllegalArgumentException
somewhere inside, and I don't know where, because text runner does not
print stack trace.
Original issue reported on code.google.com by [email protected]
on 17 May 2008 at 4:00
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.