Cucumber is one of the cornerstone for BDD in Ruby on Rails. Non technical or business participants can write tests (called as features or stories) in plain English and cucumber allows the developers to execute these tests.I was very excited when I started looking at it. In my test.feature file, I have a feature:Feature: Grant and revoke accessTo have proper security modelUser should have proper accessScenario: Revoke access of a user who do not deserves access Given Gourav is a user who do not deserves access When system run cron job to verify access Then Gourav's access should be revokedThere are two ways to execute this file:1. Cucumber as a plugin (by rake task):It starts eating 'a' and 'A' characters on windows: Feture: Grnt nd revoke ccess # fetures/grnt_nd_revoke_ccess.fetureTo hve proper security modelUser should hve proper ccessScenrio: Revoke ccess of user who do not deserves ccess # fetures/test.feture:5Given Gourv is user who do not deserves ccess # fetures/test.feture:6When system run cron job to verify ccess # fetures/test.feture:9Then Gourv's ccess should be revoked # fetures/test.feture:10I went to open source community and worked little bit on issue #81 (first encounter with Opensource community :) ) and found troubleshooting for this issue. Now "rake features" works well and give proper output.2. Cucumber as a gem:cucumber features\test.feature It gives:Feature: Grant and revoke access # features/test.featureTo have proper security modelUser should have proper accessScenario: Revoke access of a user who do not deserves accessC:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/tree/scenario.rb:70:in length': undefined methodjlength' for Scenario ng (NoMethodError)from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/tree/scenario.rb:74:in `max_line_length'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/tree/scenario.rb:78:in `padding_length'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/formatters/pretty_formatter.rb:197:in `padding_spaces'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/formatters/pretty_formatter.rb:58:in `scenario_executing'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/broadcaster.rb:15:in `__send__'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/broadcaster.rb:15:in `method_missing'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/broadcaster.rb:13:in `each'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/broadcaster.rb:13:in `method_missing'... 12 levels...from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/cli.rb:11:in `execute'from C:/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.12/bin/cucumber:6from C:/ruby/bin/cucumber:19:in `load'from C:/ruby/bin/cucumber:19I found a workaround for this:In file C:\ruby\lib\ruby\gems\1.8\gems\cucumber-0.1.12\lib\cucumber\tree\Scenario.rb on line number 69, I have changed jlength to length:@length ||= Cucumber.language['scenario'].length + 2 + (@name.nil? ? 0 : @name.length)Similarly, in file C:\ruby\lib\ruby\gems\1.8\gems\cucumber-0.1.12\lib\cucumber\tree\step.rb on line number 22 I have changed jlength to length:keyword.length + 1 + name.lengthBut for a better solution I am still working on issue #81
Well, there is so much happening to me at the moment, not that I am overwhelmed by it, in fact I am someone who likes to be immersed in her going arounds. You know, the busier it is, the happier I am, because then my stupid mind does not bring unnecessary thoughts to me. Anyway, currently I feel down, shattered, angry and frustrated like many of my Indian fellows not just because what happened in the last few days, but more because we still don’t see the much needed reform being brought in, we still don’t see the long-long slept conscience of our worthless politicians arising. Anyway, enough has already been and still being said. I only hope God gives them enough sense to implement theat. Please God, it will do even if it’s momentary, but LET THEE BE SENSIBLE. Now this was from the nations side, but there is also a change happening from the personal front. I feel little scared of myself sometimes, because never ever in my life have I thought of what will happen to me in future, but this time I am, and this is scaring me, because its stupid to be worried about the future. It scares you, because you cant think that everything will be wonderful, because everything cant be wonderful, as life would have been perfect, and its not. So you will think about the bad things happening and that is bound to make you feel bad. So basically you will be sad about something that hasn’t happened at all!! So its very bad thinking about the future, its better to let things happen naturally, keep your head down, do your work, and leave the rest to God. Yesss..this is what I have got to do. Good that I got to it finally by writing here. Humm..think that’s enough for today. Work Calling!!