coulda icon indicating copy to clipboard operation
coulda copied to clipboard

Do you have a recomendation on how to emulate cucumber tags in a coulda environment

Open planglue opened this issue 15 years ago • 3 comments

http://wiki.github.com/aslakhellesoy/cucumber/tags

planglue avatar Jul 15 '10 11:07 planglue

As I understand it, tags are used primarily for running subsets of Cucumber features/scenarios/scenario outlines and allowing to logically AND and OR those tags as well.

You could possibly do the following:

  • Write a method in Feature that accumulates Tags

  • When Scenario is called, take the accumulated Tags in the containing Feature, assign them to the Scenario, and then empty the Tag list. This way the Tags only apply to the next Scenario. It would look something like this when used:

    Feature "With tags" do

    Tag :foo
    Tag :bar
    Scenario "Using tags" do
      # The "Using tags" Scenario would now have the tags "foo" and "bar"
    end
    
    Scenario "No tags" do
      # This Scenario wouldn't have any tags because the Tag list
      # for the Feature would clear between uses of Scenario
    end
    

    end

  • Define a new argument for your Rake Tasks that would be picked up by Coulda

I would hate to have multiple Coulda users/developers have to hack deeper T::U integration themselves. I'm leaning toward providing hooks to inject procs to be executed into "setup" and "teardown". That may do the trick.

elight avatar Jul 15 '10 14:07 elight

It's been a while but I'm considering adding this, or something like it, now.

elight avatar Dec 05 '10 18:12 elight

In particular, this is closely related to https://github.com/elight/coulda/issues#issue/10

elight avatar Dec 05 '10 18:12 elight