Luis Lavena
2008-Nov-22 22:52 UTC
[rspec-users] Features and conditions for those to be executed
Hello Guys, May this question be silly, so I''m exposing myself as a complete dumb ;-) I''ve been working on a project called rake-compiler, which enable the building of extension with C compilers in a standarized way. http://github.com/luislavena/rake-compiler/tree/master The thing is been driven by features and with some specs to guide me in the task associations of rake, but not much after. Now I have a problem: I want to introduce cross compilation which can only be executed in certain environments, not all. I have specs that tell me what will happen (what things will get defined as rake tasks) and the chain, but I cannot execute it under Windows. Only under OSX or Linux can be executed (which I''m using right now to drive it). There is a way that I can exclude this feature from being executed in this case? I will prefer to avoid having a feature list to maintain, but if is the only choice, no problem. Thanks in advance for the suggestions. -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams
Andrew Premdas
2008-Nov-24 15:47 UTC
[rspec-users] Features and conditions for those to be executed
Assuming you''re writing a feature for a black box that works under linux, osx but not under windows. Can you not write a features like Given I''m on windows When I run black box I should get an error ... Given I''m on OSX When I run black box I should not get an error ... Just an idea, HTH Andrew 2008/11/22 Luis Lavena <luislavena at gmail.com>:> Hello Guys, > > May this question be silly, so I''m exposing myself as a complete dumb ;-) > > I''ve been working on a project called rake-compiler, which enable the > building of extension with C compilers in a standarized way. > > http://github.com/luislavena/rake-compiler/tree/master > > The thing is been driven by features and with some specs to guide me > in the task associations of rake, but not much after. > > Now I have a problem: I want to introduce cross compilation which can > only be executed in certain environments, not all. > > I have specs that tell me what will happen (what things will get > defined as rake tasks) and the chain, but I cannot execute it under > Windows. > > Only under OSX or Linux can be executed (which I''m using right now to drive it). > > There is a way that I can exclude this feature from being executed in > this case? I will prefer to avoid having a feature list to maintain, > but if is the only choice, no problem. > > Thanks in advance for the suggestions. > -- > Luis Lavena > AREA 17 > - > Human beings, who are almost unique in having the ability to learn from > the experience of others, are also remarkable for their apparent > disinclination to do so. > Douglas Adams > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Luis Lavena
2008-Nov-24 16:02 UTC
[rspec-users] Features and conditions for those to be executed
On Mon, Nov 24, 2008 at 1:47 PM, Andrew Premdas <apremdas at gmail.com> wrote:> Assuming you''re writing a feature for a black box that works under > linux, osx but not under windows. Can you not write a features like > > Given I''m on windows > When I run black box > I should get an error ... > > Given I''m on OSX > When I run black box > I should not get an error ... > > Just an idea, HTH >Yeah, your idea looks good. Wonder if this should be defined as a pending step or it should generate an skipped one? -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams
Joseph Wilk
2008-Nov-24 16:02 UTC
[rspec-users] Features and conditions for those to be executed
Andrew Premdas wrote:> Assuming you''re writing a feature for a black box that works under > linux, osx but not under windows. Can you not write a features like > > Given I''m on windows > When I run black box > I should get an error ... > > Given I''m on OSX > When I run black box > I should not get an error ... > > Just an idea, HTH > > Andrew > > > 2008/11/22 Luis Lavena <luislavena at gmail.com>: > >> Hello Guys, >> >> May this question be silly, so I''m exposing myself as a complete dumb ;-) >> >> I''ve been working on a project called rake-compiler, which enable the >> building of extension with C compilers in a standarized way. >> >> http://github.com/luislavena/rake-compiler/tree/master >> >> The thing is been driven by features and with some specs to guide me >> in the task associations of rake, but not much after. >> >> Now I have a problem: I want to introduce cross compilation which can >> only be executed in certain environments, not all. >> >> I have specs that tell me what will happen (what things will get >> defined as rake tasks) and the chain, but I cannot execute it under >> Windows. >> >> Only under OSX or Linux can be executed (which I''m using right now to drive it). >> >> There is a way that I can exclude this feature from being executed in >> this case? I will prefer to avoid having a feature list to maintain, >> but if is the only choice, no problem. >>You could use profiles in the cucumber.yml file. Rather than creating a long feature list you can exclude a feature from one profile. Cucumber accepts: -e, --exclude PATTERN Don''t run features matching a pattern @@@ windows: --format progress features --exclude pesky_windows_feature mac: --format progress features @@@ Then run them with: cucumber --profile windows cucumber --profile mac HTH, -- Joseph Wilk http://blog.josephwilk.net>> Thanks in advance for the suggestions. >> -- >> Luis Lavena >> AREA 17 >> - >> Human beings, who are almost unique in having the ability to learn from >> the experience of others, are also remarkable for their apparent >> disinclination to do so. >> Douglas Adams >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >
Luis Lavena
2008-Nov-24 19:10 UTC
[rspec-users] Features and conditions for those to be executed
On Mon, Nov 24, 2008 at 2:02 PM, Joseph Wilk <josephwilk at joesniff.co.uk> wrote:> Andrew Premdas wrote: >> >> Assuming you''re writing a feature for a black box that works under >> linux, osx but not under windows. Can you not write a features like >> >> Given I''m on windows >> When I run black box >> I should get an error ... >> >> Given I''m on OSX >> When I run black box >> I should not get an error ... >> >> Just an idea, HTH >> >> Andrew >> >> >> 2008/11/22 Luis Lavena <luislavena at gmail.com>: >> >>> >>> Hello Guys, >>> >>> May this question be silly, so I''m exposing myself as a complete dumb ;-) >>> >>> I''ve been working on a project called rake-compiler, which enable the >>> building of extension with C compilers in a standarized way. >>> >>> http://github.com/luislavena/rake-compiler/tree/master >>> >>> The thing is been driven by features and with some specs to guide me >>> in the task associations of rake, but not much after. >>> >>> Now I have a problem: I want to introduce cross compilation which can >>> only be executed in certain environments, not all. >>> >>> I have specs that tell me what will happen (what things will get >>> defined as rake tasks) and the chain, but I cannot execute it under >>> Windows. >>> >>> Only under OSX or Linux can be executed (which I''m using right now to >>> drive it). >>> >>> There is a way that I can exclude this feature from being executed in >>> this case? I will prefer to avoid having a feature list to maintain, >>> but if is the only choice, no problem. >>> > > You could use profiles in the cucumber.yml file. Rather than creating a long > feature list you can exclude a feature from one profile. > > Cucumber accepts: > -e, --exclude PATTERN Don''t run features matching a pattern > > @@@ > windows: --format progress features --exclude pesky_windows_feature > mac: --format progress features > @@@ > > Then run them with: > cucumber --profile windows > cucumber --profile mac > > HTH,Thanks Joseph, I will love to drive the "show" only using "rake features" or by calling cucumber features directly, thus avoiding to remember that exclusion list. BTW: the pesky feature will be OSX and Linux, not Windows, so the pesky ones are posix, not Windows ;-) -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams