Questions tagged [specs]

The specs is a software's design and the features specification, you can through it to know the software's specifications. General, the open source code will have specs.

If you want to become a contributor for open source lib, through specs you can know how to design the lib, you can write standard code for it.

108 questions
6
votes
1 answer

BDD tool for Scala supporting reusable parameterized Gherkin clauses

Is there any BDD tool for Scala supporting reusable parameterized Gherkin clauses? I would like to be able to have the ability to use specs like these: Given number 4 is entered When "+" is pressed And number -1 is entered And "*" is pressed And…
Alexey Tigarev
  • 1,915
  • 1
  • 24
  • 31
6
votes
1 answer

"scala is not an enclosing class"

When compiling this specification: import org.specs.Specification import org.specs.matcher.extension.ParserMatchers class ParserSpec extends Specification with ParserMatchers { type Elem = Char "Vaadin DSL parser" should { "parse…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
6
votes
1 answer

Unit-testing Spring applications using Scala's Specs

We have a large infrastructure that's highly dependent on Spring Framework. Recently I began writing code in Scala and test it using Specs. This is all great but at some point I need to use Spring-dependent features (Such as a…
Electric Monk
  • 2,192
  • 2
  • 23
  • 33
6
votes
0 answers

How to mock Blob and Click() in jasmine Specs in angular js

How to write Jasmine specs for Blob and Click() event. Every time I am running Specs its downloading file. Can I mock this (and browser also). Thanks var csvFile = "a,b,c",filename="abc.csv"; var blob = new Blob([csvFile], { type:…
iPhoneDev
  • 2,995
  • 4
  • 33
  • 44
6
votes
3 answers

Creating a spec helper in rubymotion

I have some common methods used in a couple different specs, I want to extract them to some place like a spec helper that is accessible from all specs. Anyone know how to do this?
jacob
  • 2,284
  • 3
  • 20
  • 21
5
votes
2 answers

Specs2: How to turn a Seq[Matcher[A]] into a single Matcher[A]?

Given a sequence Seq[Matcher[A]] I want to obtain a single Matcher[A] that succeeds when all matchers inside the sequence succeed. Edit The answer provided by myself seems a bit clumsy and in addition it would be nice if all failing matchers of the…
ziggystar
  • 28,410
  • 9
  • 72
  • 124
5
votes
4 answers

Generating arbitrary (legal) Unicode character with scalacheck?

I'm trying to create a generator that produces (non-zero-length) legal unicode strings, with scalacheck 1.6.6 and specs 1.7 (scala 2.8.1). I hoped I could just create generators like: object Generators { def unicodeChar: Gen[Char] = …
5
votes
1 answer

Matching any parameterless function as an argument in scala Mockito

I'm trying to verify the following method gets called using Mockito: class Notifier { def forward(request: ServletRequest)(onFailure: => Unit) : Unit } Here's the verification on a mock: val notifier = mock[Notifier] there was…
Garrett Hall
  • 29,524
  • 10
  • 61
  • 76
5
votes
2 answers

Seq empty test with specs2

How can I check if a Seq[String] is empty or not using specs2 in Scala ? I am using seq must be empty or seq.length must be greaterThan(0) but I end up always with type mismatch errors. ret is Seq[String] ret.length must be greaterThan(0) [error]…
mete
  • 589
  • 2
  • 6
  • 17
4
votes
1 answer

Selenium, specs and scala

I'm looking an info or some project for selenium testing with scala specs. How can I call selenium tests from my scala specs code?
kolchanov
  • 2,018
  • 2
  • 14
  • 32
4
votes
1 answer

Rspec routing specs give failure with param id reversed?

My routing specs for rspec give unclear error back. In expected params v/s the real param the id param is at reversed position. Why and how to resolve? require "spec_helper" describe GameController do describe "routing" do game =…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
4
votes
2 answers

RSpec Can Only See Classes in the Root of my Lib Directory

RSpec (2.12.2) is giving me a hard time. If I want to reference a class in one of my specs and that class is not in the root of my /lib directory, it throws an error: no such file to load -- test (LoadError) It seems that my specs can be nested in…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
3
votes
0 answers

XMLHttpRequest.setRequestHeader lowercases all header names, any official explanation to such behavour?

It seems that XMLHttpRequest.setRequestHeader makes all header names lowercase, it's not against or by specs, since they leave a field for free interpretation around this, but does anyone know if there's any official statement or explanation to why…
jayarjo
  • 16,124
  • 24
  • 94
  • 138
3
votes
2 answers

Specs implicit conversion conflicts with Scala Predef

I have a type alias in my code like so: type Time = Double And I often in both tests and in applications pass Long values to functions that use this type. For instance: def at(time : Time) : T = { // Do Something } …
seadowg
  • 4,215
  • 6
  • 35
  • 43
3
votes
2 answers

In Scala Specs, what is the "must" function?

I'm working with some Specs tests and I'm trying to understand what the "must" function is, and what it does. I am unable to find its declaration or implementation anywhere in the specs source, and I'm trying to understand what it does. Here are…
ampersandre
  • 3,156
  • 3
  • 29
  • 37