Re: [rspec-users] New Zentest, any feedback?
So I notice that Ryan released a new zentest gem today. It looks like it has been refactored a bit. Are there any brave guinea pigs/canaries in the RSpec/Cucumber community who have tried it out? Any issues? I do see that someone has been reporting some problems with multiruby which is a part of zentest which a lot of folks don't use as much. A quick test shows that it still reruns cucumber when I change a feature and runs rspec when I change a ruby file. and that it does not rerun anything when I touch a file for which there is an exception (e.g. when I do something with git, add_exception %r{\.git} triggers nothing anymore, whereas the previous gem triggered a run of cucumber, which was remendously annoying). I'm not using rails and also not using any other sort of additional framework. no webrat, etc. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] autotest?
Is there some configuration I need to do to get rid of unit/functional tests and only run rspec+cucumber? [...] I guess I should add this in some form to the rspec wiki ;) Done: http://wiki.github.com/dchelimsky/rspec/autotest-integration Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] autotest?
Is there some configuration I need to do to get rid of unit/functional tests and only run rspec+cucumber? [...] I guess I should add this in some form to the rspec wiki ;) Done: http://wiki.github.com/dchelimsky/rspec/autotest-integration Thanks Kero. I added a bit of information about autospec to that wiki page. I keep learning things... add_mapping returns nil, that's why it works for autotest/rspec.rb But I've ran strace to confirm the problem I had with non-nil myself: ~/.autotest is ran *before* ./.autotest on my system (debian unstable). Are you sure it's the other way around on your system? I haven't seen autospec docs that claim one or the other. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Including extra directories for Autospec
Then I edit the files like so: ./autotest: Autotest.add_hook :initialize do |at| at.add_mapping(%r%^spec/something/.*_spec\.rb$%) do at.files_matching(%r%^spec/something/.*_spec\.rb$%) end end Do you perhaps have a ~/.autotest with a hook to :initialize ? If so, let it return nil, like this: Autotest.add_hook :initialize do |at| %w{.svn .hg .git}.each {|exception| at.add_exception(exception) } nil end It's documented, but a nasty default behaviour. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
[rspec-users] request for gists / pasties
Questions: [...] * pls provide a full backtrace * best in a gist or pastie Imagine someone looking at the problem report two years from now. No pastie. Then the solution (if provided) comes without a complete problem. Like code without a test. Put it in an attachment, or whatever, but keep the two together, please. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] top posting and plain text
So let me get this right, you agreed with Aslak that you shouldn't top post. by top posting lol.. Yes. :) Sarcasm somethings doesn't come across well over email I suppose. Not only that, he did it in html so it was impossible for me to see whether it was top or bottom. The sarcasm was clear enough, tho ;) +1 from me, too. I'm adding a request: cut out the paragraphs of the email that you are not responding to. I'm encountering plenty of emails that don't fit on my screen (which is much bigger than an iPhone) and turn out to contain not much more than yes, thanks or see lighthouse url. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [Cucumber] gem missing dependencies
Polyglot requires hoe because it's built using newgem. It's a nuisance, and I'll be happy to remove it, or make hoe a dev-time dependency only if possible. I've contacted Dr Nic to ask how to proceed. In my view, using hoe shouldn't add a runtime dependency. Hm, snippet from long `p spec` (from my prev email): @dependencies=[#Gem::Dependency:0xb7c922fc @version_requirement=nil, @name=hoe, @version_requirements=#Gem::Requirement:0xb7c922c0 @version=nil, @requirements=[[=, #Gem::Version +1.8.0]], @type=:runtime] So your dependency is/was runtime-only, it seems. But the stuff got fixed in the meantime! I'm guessing it's the rubygems upgrade on my system. $ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] $ gem -v 1.3.2 $ gem list *** LOCAL GEMS *** builder (2.1.2) calibre-semaphore (1.0.0) cucumber (0.3.2) diff-lcs (1.1.2) polyglot (0.2.5) rspec (1.2.6) term-ansicolor (1.0.3) treetop (1.2.5) $ gem dependency polyglot Gem polyglot-0.2.5 hoe (= 1.8.0, development) = not runtime anymore! same 0.2.5 polyglot gem! $ cucumber 0 scenarios () 0 steps () $ Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [rspec] loading specs as an object model without running them
So basically, I want to do something like this: examples = load_examples_without_running examples.each {|example| puts example.description} [snip] I'm working into a big corporate in Australia, and they are demanding traceability of tests back to requirements. I'm already using Mingle to manage story cards, and I'm hoping to let the testers build in the traceability via code. So I've got a Mixin to the examples so that I can declare the id of the story that the test maps to. It looks something like this: describe FunctionalArea do it automates some acceptance test declared on a story do traces_to_story 35 # test implementation end end I would have expected Cucumber to map stories to scenarios/examples by having them in the same file (and a @tag if someone insists that a number referrring an external doc is better for tracability). I would have expected RSpec to cover a lower level that is of no interest to the person wanting traceability, as that person can not judge whether the code works anyway (YMMV). Besides, a spec can apply to more than one requirement; or to no particular requirement at all. I'm expecting this from regulations that deal with medical devices. Validation has to happen on story level; risk mitigation may apply to lower levels, though. Our department is working on several projects that'll result in medical devices and we are learning how regulations, audits and things work for real. So I'd like to hear why you are trying to do what you do. There can be other requirements for other reasons. What traceability are you looking for in these tests? Why do you look at the RSpec level? Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Before and After blocks for individual feature files?
I'd like to do this: Feature: user signup Before: Given I have a cleaned up database Scenario Outline: Sign Up Given I am on the signup page When I sign up using userid Then I should see message Examples: |userid |message | |userX |successful signup | |userX |duplicate userid | Feature: user signup Scenario: succesful signup When I sign up using Kero Then I should see welcome Kero Scenario: failed signup of existing user Given there is a user Kero When I sign up using Kero Then I should see trying to impersonate someone else NB: yes, clean the database before every scenario Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [Cucumber] gem missing dependencies
Hi list Clifford, Looks like installing hoe (which brings in rubyforge and rake) solved the problem below. I just fixed that: http://github.com/aslakhellesoy/cucumber/commit/23cbc9b6c54ebe1ecf568610c2696762f22f0b06 Thanks Aslak, that was quick, but... I had to try that, and the 0.3.1 release made that very easy. Didn't help. looks like polyglot is the culprit, from some extra output I created from rubygems: #Gem::Specification:0xb7c92d60 @extensions=[], @summary=Allows custom language loaders for specified file extensions to be hooked into require, @version=#Gem::Version 0.2.5, @loaded_from=/var/lib/gems/1.8/specifications/polyglot-0.2.5.gemspec, @original_platform=nil, @post_install_message=nil, @description=Allows custom language loaders for specified file extensions to be hooked into require, @dependencies=[#Gem::Dependency:0xb7c922fc @version_requirement=nil, @name=hoe, @version_requirements=#Gem::Requirement:0xb7c922c0 @version=nil, @requirements=[[=, #Gem::Version 1.8.0]], @type=:runtime], @requirements=[], @test_files=[test/test_helper.rb, test/test_polyglot.rb], @require_paths=[lib], @extra_rdoc_files=[History.txt, License.txt, Manifest.txt, README.txt, website/index.txt], @date=Tue Mar 03 00:00:00 +0100 2009, @new_platform=ruby, @executables=[], @authors=[Clifford Heath], @cert_chain=[], @name=polyglot, @required_rubygems_version=#Gem::Requirement:0xb7c92b6c @version=nil, @requirements=[[=, #Gem::Version 0]], @files=[History.txt, License.txt, Manifest.txt, README.txt, Rakefile, config/hoe.rb, config/requirements.rb, lib/polyglot.rb, lib/polyglot/version.rb, log/debug.log, script/destroy, script/generate, script/txt2html, setup.rb, tasks/deployment.rake, tasks/environment.rake, tasks/website.rake, test/test_helper.rb, test/test_polyglot.rb, website/index.html, website/index.txt, website/javascripts/rounded_corners_lite.inc.js, website/stylesheets/screen.css, website/template.rhtml], @has_rdoc=true, @specification_version=2, @loaded=true, @signing_key=nil, @default_executable=nil, @email=cjhe...@rubyforge.org, @required_ruby_version=#Gem::Requirement:0xb7c92ce8 @version=nil, @requirements=[[=, #Gem::Version 0]], @rdoc_options=[--main, README.txt], @bindir=bin, @rubygems_version=1.2.0, @homepage=http://polyglot.rubyforge.org;, @platform=ruby, @autorequire=nil, @rubyforge_project=polyglot [#Gem::Dependency:0xb7c922fc @version_requirement=nil, @name=hoe, @version_requirements=#Gem::Requirement:0xb7c922c0 @version=nil, @requirements=[[=, #Gem::Version 1.8.0]], @type=:runtime] Clifford, let's take this off-list. Bye, Kero. fresh install of debian lenny, upgraded to unstable. $ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] $ gem -v 1.2.0 $ gem list *** LOCAL GEMS *** builder (2.1.2) cucumber (0.3.0) diff-lcs (1.1.2) polyglot (0.2.5) rspec (1.2.4) term-ansicolor (1.0.3) treetop (1.2.5) $ cucumber /usr/lib/ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem hoe (= 1.8.0) (Gem::LoadError) from /usr/lib/ruby/1.8/rubygems.rb:134:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:49:in `gem' from /var/lib/gems/1.8/bin/cucumber:18 ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [Cucumber] gem missing dependencies
This is the umpteenth time polyglot messes up. Polyglot is broken broken broken. Cucumber doesn't use it, but can't escape it, because Treetop *always* loads it. I have tried to lobby the Treetop developers to make it optional. I have sent a patch (as a treetop fork). It's still in there. What else can I do? How far do you want to take it? We got gems, github. Think RPath, fedora spins, debian derivatives. Grab all stuff from rubyforge and publish your own gem-feed. Tweaked to fit your needs. But for that scheme to work, others should not lure us away from your feed with their own, that tweaks other gems. So I guess what you really need is a policy for gems on rubyforge. rubygems looking over some quality and cohesiveness, like (linux) distros check quality and make sure packages work together. The kind of check we'd want to do on polyglot is easy to automate. If it'd be done when creating the gem, as well as on rubyforge before it's put in the feed, I guess noone can complain. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
[rspec-users] [Cucumber] gem missing dependencies
Hi! Looks like installing hoe (which brings in rubyforge and rake) solved the problem below. Who builds the gem / should I report this to / should I send a patch ? Bye, Kero. --- fresh install of debian lenny, upgraded to unstable. $ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] $ gem -v 1.2.0 $ gem list *** LOCAL GEMS *** builder (2.1.2) cucumber (0.3.0) diff-lcs (1.1.2) polyglot (0.2.5) rspec (1.2.4) term-ansicolor (1.0.3) treetop (1.2.5) $ cucumber /usr/lib/ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem hoe (= 1.8.0) (Gem::LoadError) from /usr/lib/ruby/1.8/rubygems.rb:134:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:158:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:157:in `each' from /usr/lib/ruby/1.8/rubygems.rb:157:in `activate' from /usr/lib/ruby/1.8/rubygems.rb:49:in `gem' from /var/lib/gems/1.8/bin/cucumber:18 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [Cucumber] Tables
Without adding a new feature to Cucumber, I'd probably do Scenario Outline: Religious menus Given the customer is a Religion When they ask for the menu Then they should be presented with Meats Examples: | Religion | Meats | | Christian | Pork, Lamb, Veal | | Jewish|Lamb, Veal | | Muslim|Lamb, Veal | | Hindu |Lamb | This certainly would work, but what if we're not dealing with booleans (Lamb/No Lamb), but numbers? |34,76,89| doesn't read so well... Actually, I did just that, together with a colleague. (I removed info about what the algorithm actually computes, but the +/- indicates a threshold for that algorithm is/is not crossed; there are four algorithms not two; sorry about all that editing) Scenario Outline: measuring a series of daily weights Given patient Lara When she measures her weight as weights kg Then ROT algorithm result should be ROT And MACD algorithm result should be MACD ... Examples: | weights | ROT | MACD | ... | 71 72.5 72 73.3 73.6| + | - | | 71 72 73 74 75 | - | + | ... I find this readable enough (it is much more readable than the long series of scenarios we had before). The numbers are a sequence as input for the algorithm. The sequences are concrete examples to show the differences between the outcomes of the four algorithms. What strikes me in your meat examples, is that there is a mapping from religion to types of meat that can be served (or dishes, in the end). You can test that the mapping works, why are you trying to be exhaustive in your examples? Bye, Kero. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [Cucumber] Options in tables
In Cucumber I want to remove duplication from my examples tables. see http://gist.github.com/99516 for an example of the type of situation I am facing. I would like the second example to be equivalent to the first. To do this... I need cucumber to read a row in the examples and notice the 'options', then run it as if it were several rows in the table, one for each possible combination of options. Anyone else find this useful? .. or got any suggestions for better ways of doing it? 1) See another current thread in this list: [Cucumber] Tables 2) [new|expired] does not matter, so you don't need the column at all you can put two checks in the step definition, I think. perhaps this allows you to write the remaining steps in another way, without duplication of steps. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Cucumber - step negating another expecting step
I've been doing something similar. I think the benefit of having half the steps(each can be negated) wins over the small impact it has on step readability. Personally I started adding stuff like this(perhaps not as DRY but simple enough): Then /^the correspondence should (not )?have inclusions$/ do |negate| if negate @outcorr.inclusions.should be_empty else @outcorr.inclusions.should_not be_empty end end What's the advantage of having half the steps? They should be grouped in a nice way in files anyway. This one's quite readable, though. yes, the regexp in the step matcher is a good one to dry it up So I end up with this one: Then /^I (should|should not) see the people search form$/ do |maybe| people_search_form_should_exist maybe == should end should ... exist ... maybe... should Unreadable? and the method: def people_search_form_should_exist it_should_exist _not = _not unless it_should_exist response.send should#{_not}.to_sym, have_tag('form#frmSearch') end Convoluted. only because I find it easier to read (when I don't need to jump to the method), but yours maybe faster (shorter it is), I could come back to it later and benchmark both If you don't mind using the #send (I was trying to help you get rid of it) then just do this: Then /^I (should|should not) see the people search form$/ do |maybe| response.send maybe.underscore.to_sym, have_tag('form#frmSearch') end If you go with this kind of abstraction, this solution and the topmost in this mail at least do not introduce extra methods to deal with the should/should not. more methods to have fewer steps can not be an advantage, I think. But the readbility of Then /^I should see the people search form$/ do response.should have_tag('form#peopleSearch') end Then /^I should not see the people search form$/ do response.should_not have_tag('form#peopleSearch') end is higher for me, as I only need to think what the have_tag means, but do not have to parse the should/not, send, underscore and to_sym. The difference in readability is from about 2 seconds to at least 10 seconds. That's a disadvantage that I'm not willing to pay for any advantage of having fewer steps. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Spec run heuristics (Re: Cucover: coverage-aware 'lazy' cucumber runs)
That would be very cool, you have lots of good ideas there. Being able to plug in your own file-change strategy would be killer. Another cool idea I ran across the other idea is being able to specify in your examples that which ones are focussed. Meaning, autotest will only run the focussed ones and not bother running the entire suite. Once you have solved the problem at hand you remove the focussed tag and the whole suite is then ran. This idea, *which is already implemented*, comes from Micronaut[1]. The idea is very similar to Cucumber's and RSpec's[2] tagging feature (yet to come for rspec). The cool thing about micronaunt is that they have tied it into autotest. Ideally, we could be able to tell autotest, or whatever program, to only run tests that are tagged a certain way-- and then you could override that with the focused tag. So, we can add that to our list of cool things to have. :) Are you saying you want multiple tags and let autotest do logic on them? - run everything focus and current_feature - run everything current_feature or related_to_it Or are you saying you should explicitely specified which test went wrong (would it be nice if autotest just ran all your recently failed features first and the rest later; compared to the last failure only, as it is supposed to do now, afaik; perhaps after running previously failed features, it can run newest features first, finally followed by the other features). Or are you saying it's going to be separate from tags completely? I'm feeling my first idea will run out of hand (adding complexity, while not solving a specific need), the third sounds bad from a technical Point of view. The second one comes from the observation that focussing is a process, not a property. You state you remove the focussed tag yourself. important could be a property, if you don't remove it. Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [cucumber] Cucumber and CI
yeah, you guys are probably right on this. I was just over stating. :) Ah, but Waterfall is indeed like the Emissaries of the Shadow. If you defeat one of them, in one form, another one will always appear, take shape, and grow... I myself have heard well-meaning product managers say When we go for the rewrite, we are going to make sure we specify each feature, first, before coding them! They said that because the last effort - code-and-fix - had grown until it died under the weight of its cruft. They perceived their inability to safely request new features as evidence that they did not specify enough, up-front. If you redo a product, you have learned what it should look like. Thus, you can specify much more in advance. Nothing wrong with that, it came out of the feedback loops. I'm curious, do you really expect them to go for a rewrite? These managers knew better than to use classic Waterfall, but they still didn't understand that Big Requirements Up Front is essentially Waterfall's worst aspect. And so they re-invented Waterfall, yet again, in yet another form. That's because they still have not learned that in order to manage uncertainty, you have to acknowledge that there is uncertainty, first. Which is not to say I'm doing a good job at explaining that to my customer, yet :( Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] [cucumber] Cucumber and CI
I find pushing last thing at night even more bizarre to be honest :/ If you're are going home, it seems reasonable that other people might be, ergo there won't be many more changes made (an assumption granted). Also, if they are going to continue to work and make changes, why force them to merge a broken/half-done/possibly-to-be-completely-redone later commit. Makes no sense to me :/ I think that's because you're assuming that there's just one active thread of code. If you're not pushing to the *integration* branch, you're not forcing anyone to do anything. You can push your own in-progress development branch to the server (in SVN, in Git, in anything that supports branches at all) just to have it someplace other than your own machine, and that imposes no cost on anyone else. I do it all the time just to be paranoid. My laptop might get stolen is a perfectly sensible reason to take three seconds before closing the lid. Or My place might burn down, or I might get hit by that bus I was waiting for, or I might have an epiphany and quit my job tomorrow morning to become a chess grandmaster, or even just I wonder if my manager would like to look at my functional and elegant code. (In some places it might even be I'd better prove to my manager that I did something today.) If you don't show up for the next 6 weeks or not at all, that last hour of work of you is not going to matter to anyone. Really. If you *do* show up you're likely worrying too much about the lost hardware, or your lost house. I'd say the only person I'd commit unfinished code for, is myself. Which means I don't do it at the end of the day, but that should not prevent you from doing it. In any case: pushing to the team's main VCS repository may be a necessary step for integration, but it doesn't mean every push has to trigger an integration. Not if you've created a consistent and well-understood culture of branching. I'm trying to get that culture going :) The understanding is tough... With the main problem being that most of the co-devs are not software engineers. So I'll do the merging of their branches with the master (they do hg branch and hg push, I do hg pull, hg merge and hg push). But I got them to use cucumber! I have to help a lot, of course, but that's a price i'm willing to pay. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Time for seperate cucumber mailing list?
Because traffic is increasing That's a bad reason to split a list. Because cucumber really is a seperate mature topic now. Good point. Can any newbies to the scene comment if this is confusing? It is mature. But is it separate? Because rspec overlap is getting smaller (relatively) Meh. I don't know about that. These are two tools I use every day to drive out changes to my code. I'm still learning when is the right time to use each one, and it varies a lot, so for me there's still significant overlap in terms of the people I want to share ideas with. Most interesting (imho) discussions on this list are about the larger picture. Individuals and interaction over process and tools splitting a mailing list reduces interaction ;) And isn't it wonderful how a question about regexps triggers a team to standardize their language? Too bad if you miss that because the thread was on the other mailling list... I skip the Rails questions, mostly; but questions about too often needing Given I am logged in as XYZ with roles A B C contribute to discussions about GivenScenario and nested steps, i.e. helps driving the direction of our tools. (meaning that I could argue that rails related stuff should go to its own mailing list, but that I will not argue that; use delete-thread in your favorite mail progam instead.) I'd rather see people using topics like [Rails] my models and viewers are out of control! [Cucumber] I can not heckle the pickles [spec] it should do to allow people to filter automagically what they are not interested in. A little bit of discipline that should come easily when you wonder the entire day about the best specs and stories, and variable names, no? Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Cucumber and autospec do not work ?
I have added th tickets for you and am working on fixes for them. Although, I think the last one needs to be discussed more so please add your thoughts to that ticket. http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/117-cli-crashes-with-blank-cucumberyml http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/118-confusing-error-message-with-blank-default-profile-defined http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/119-not-using-default-profile-when-expected Thank you! Comment added to 119 Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
[rspec-users] Autospec does not work w/ cucumber features?
Hi! And now for the second part of the subject of my previous mails :) $ cat cucumber.yml default: . autotest: -v . autotest-all: -v -f progress . $ cucumber -i . -f progress PP Pending Scenarios: 1) enlightenment (meditation) $ AUTOFEATURE=true autospec # bug! prompt returns immediately, ZenTest gem not a dependency? a warning that autotest was not found would be nice. $ sudo gem install ZenTest Successfully installed ZenTest-3.11.0 1 gem installed Installing ri documentation for ZenTest-3.11.0... Installing RDoc documentation for ZenTest-3.11.0... $ AUTOFEATURE=true autospec ^CInterrupt a second time to quit ^C it just does not do anything at all... and I haven't had any luck with earlier versions of cucumber, either. Nor does autospec become more active when I have implemented some features already. afaik I did everything mentioned in http://github.com/aslakhellesoy/cucumber/wikis/autotest-integration any ideas? NB: where to file the autospec/autotest warning missing bug; rspec plain? rspec-cucumber? Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Autospec does not work w/ cucumber features?
$ AUTOFEATURE=true autospec # bug! prompt returns immediately, ZenTest gem not a dependency? a warning that autotest was not found would be nice. Huh. The autospec command comes from RSpec; do you have this issue without setting AUTOFEATURE=true? Yup. But as I only have features, I would not expect it to do anything in that case ;) Bye, Kero. ___ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
[rspec-users] Cucumber and autospec do not work ?
Hi! I'm not sure this is how cucumber should behave. Should I file one or three tickets at http://rspec.lighthouseapp.com/projects/16211-cucumber ? $ cucumber -v 0.1.12 $ mkdir fresh $ cd fresh $ cucumber cucumber.yml was not found. Please define your 'default' and other profiles in cucumber.yml. Type 'cucumber --help' for usage. $ touch cucumber.yml $ cucumber # bug! should not crash on broken config file /var/lib/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/cli.rb:146:in `parse_args_from_profile': undefined method `[]' for false:FalseClass (NoMethodError) from /var/lib/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/cli.rb:47:in `parse_options!' from /var/lib/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/cli.rb:20:in `parse' from /var/lib/gems/1.8/gems/cucumber-0.1.12/bin/../lib/cucumber/cli.rb:11:in `execute' from /var/lib/gems/1.8/gems/cucumber-0.1.12/bin/cucumber:6 from /var/lib/gems/1.8/bin/cucumber:19:in `load' from /var/lib/gems/1.8/bin/cucumber:19 $ echo default: cucumber.yml $ cucumber # bug! default profile defined but irretrievable Could not find profile: 'default' Defined profiles in cucumber.yml: * default $ echo default: . cucumber.yml $ vim enlightenment.feature $ cucumber -v# bug! no reason not to use the default profile Ruby files required: Features: $ cucumber -v -i -p default Ruby files required: Features: * ./enlightenment.feature Story: enlightenment # ./enlightenment.feature As a Developer I want to achieve enlightenment So that I can be at peace with my code Scenario: meditation# ./enlightenment.feature:6 When I meditate indefinitely # ./enlightenment.feature:7 Then I achieve enlightenment # ./enlightenment.feature:8 2 steps pending $ __ How can I change the world if I can't even change myself? -- Faithless, Salva Mea ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] .html.erb files and autotest
The benefit of doing that is it spots files that you may not have spec'd that you want spec'd. On the flip side you end up with a bunch of noise but you can eliminate that w/ the :initialize hook: Autotest.add_hook :initialize do |at| at.add_exception 'some_file_i_want_ignored' end That goes in .autotest in the root of your project, where you type the autotest command. I'm probably too much of a Ruby coder, but an Exception is an existing Ruby class. add_exception seems strange to me. How about at.except, at.ignore_file or at.ignore ? I like the last one best. Bye, Kero. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] Do you think it would look cleaner?
I was looking over some of my specs. I was thinking that the following: @game.should_receive(:name).and_return('The Battle for Blaze') @game.should_receive(:people).and_return(500) @game.should_receive(:activated).and_return(true) Would it look cleaner if I could do this instead? @game.should_recieve_and_return( :name = 'The Battle for Blaze' :people = 500 :activated = true) Opinions? A Hash is not ordered. (but the 1st set of statements is) Bye, Kero. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] executing code after each step of a story
Hi! After a bit of digging in runners, I found that I need a formatter, really. now --format FORMAT:WHERE is explained properly by --help. --runner otoh, is not; see below. For the purpose of recording a user story (demo, webdemo), I run espeak for each step and then some. It seems to me, a formatter is the correct thing to use for this, but it demands a WHERE parameter that I am not going to use, as such (I need to store audio snippets and combine with screenshots into video; grabbing screens is not formatting anymore; a listener would be better, see below). Would it be an idea to not stop executing when I specify -f Speaker: which indicates I know I would need the WHERE, but actually don't? But worse, when I specify -f p -c -f Speaker, I get my speaker to speak *before* the coloured text is printed. This is not nice for a live demo, since the customer can not read along. When I specify -f Speaker -f p -c, I get my speaker to get one step ahead of the normal formatter (it speaks, it speaks, the prints, speaks, prints and prints). I am confused as to why that happens. how can I execute some code after each step of a story. Is there some kind of listener documentated. Very little is documented, and Story Runner is still considered experimental (i.e. API's subject to change), but here is what you can do with the 1.1.1 release: World.add_listener(mylistener) Found that before. Together with - Spec::Story::Runner::ScenarioRunner#add_listener - Spec::Story::Runner::StoryRunner#add_listener This is at least inconsistent; where is the StepRunner? World really seems too generic a name. Also, a formatter, though it hooks into similar things, is not a listener. What's the relation? If I do not know the relation, I can never decide what the appropriate time is to make a screenshot. And why, when I specify --runner Spec::Story::Runner::StoryRunner or --runner Spec::Story::Runner::ScenarioRunner do things break? (or, perhaps, what is a custom runner supposed to run?) I need to mess with my own runner when I want to see gtk things happening on screen (which would be even cooler for demoes). This is the reason I started messing with runners and only noticed the formatters much later... I succeeded in that, though it is not pretty (have to call exit myself), is there any way to disable the at_exit registered stuff? to be clear, I have Ruby code like require 'spec' Story { Scenario { When {} Then {} } } and run it with `ruby that_code.rb` (whereas `spec that_code.rb` is very silent; a warning would be nice) I'll post some videos and code when I'm really done :) Bye, Kero. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users