Skip to content
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

Decision Table implicit conversion #210

Closed
wants to merge 1 commit into from
Closed

Decision Table implicit conversion #210

wants to merge 1 commit into from

Conversation

asflierl
Copy link
Contributor

@asflierl asflierl commented Nov 5, 2013

Hi Eric,

I noticed that in the following spec using a decision table, the name of the example method appears in the output when the decision table is converted to a spec part implicitly. It doesn't when I explicitly invoke ".form" on the table.

package meep

import org.specs2._
import org.specs2.form._
import org.specs2.specification._

class MeepSpec extends Specification with Forms { def is =
s2"""
The road runner should run and meep. $thisWordShouldNotAppear
"""

  def thisWordShouldNotAppear =
    Meeper.
      th("movement", "sound", "movement & sound").
      tr("running", "meep", "running & meep").
      tr("waling", "toot", "walking & toot")   // if I add .form after this, it works fine

  case class Meeper(form: Form = Form()) {
    def tr(movement: String, sound: String, movementAndSound: String) = Meeper {
      def both = prop(movement + " & " + sound)(movementAndSound)
      form.tr(movement, sound, both)
    }
  }
  object Meeper {
    def th(title1: String, titles: String*) = Meeper(Form.th(title1, titles:_*))
  }
}

So with this pull request, I changed the implicit conversion from the table to a spec part to behave identically to the conversion from a form to a spec part. I'm not entirely sure what was/is going on, maybe an "auto example" was triggered by some kind of "example wrapped in example" kind of thing?

If this was indeed the expected behaviour, please ignore this pull request. :) But if so, you should probably document it somewhere. (The user guide on decision tables suffers from this behaviour, too, btw.)

Hope this helps anyway.

Kind regards
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant