Re: [rspec-users] Cucumber vs Rails Fixtures

2009-05-21 Thread Phlip
aslak hellesoy wrote: http://groups.google.com/group/cukes What, no gmane yet?? (-: I would have preferred: "I have set up GMane" Netiquette: I would _not_ set someone else's group up on GMane - even if it were just a Google Group... -- Phlip http://flea.

Re: [rspec-users] Cucumber vs Rails Fixtures

2009-05-20 Thread Phlip
Ben Mabey wrote: http://wiki.github.com/aslakhellesoy/cucumber/fixtures Ding! That would have been my next click in my Googling. Let's hope this thread pushes that up. > http://groups.google.com/group/cukes What, no gmane yet?? (-: --

[rspec-users] Cucumber vs Rails Fixtures

2009-05-20 Thread Phlip
e screwed up each time they run fixtures? Enquiring minds want to know! -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Using "return" in rspec test

2009-05-18 Thread Phlip
eaking, tests should either pass or fail, and they should not skip any blocks.) -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] HowTo Specify A Method is Called Within A Controller's Action

2009-05-16 Thread Phlip
I would also build a scratch Rails site and throw the "salted authentication" plugin at it. That generates a very nice set of unit tests which show how things like this are done, IIRC! -- Phlip http://flea.sourceforge.net/resume.html ___

Re: [rspec-users] How to test update_attribute with mocha?

2009-05-15 Thread Phlip
ndreds of tests, including mocks, including controller tests that went a little too far, including very fragile tests, and I never once had the inclination to mock update_attribute. The real attribute is just so easy to detect! Run fragile tests more often and revert more often. --

Re: [rspec-users] How to test update_attribute with mocha?

2009-05-14 Thread Phlip
e point of unit tests (which include the alleged "functional tests" in Rails) is to fail more often than production code would fail. Not less often. -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec

Re: [rspec-users] How to test update_attribute with mocha?

2009-05-13 Thread Phlip
en (update_attribute, save, or whatever). A unit test might care, but functional tests need a little more float... -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How To Drive Out AJAX Functionality in a Rails View

2009-05-12 Thread Phlip
ent like this. When's the last time you paired with someone in the RSpec community? Well it's not for want of trying! -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfor

Re: [rspec-users] How To Drive Out AJAX Functionality in a Rails View

2009-05-12 Thread Phlip
d_js_to (aka assert_rjs_) is it's a real JavaScript lexer, not a Regexp, so when I get it working it will be very accurate! -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How To Drive Out AJAX Functionality in a Rails View

2009-05-12 Thread Phlip
The RSpec community, in my exalted opinion, mocks too much! If you can't use the real thing, it's too coupled, so break it up! -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-28 Thread Phlip
Bump? Please explain how it doesn't work. Output, error etc. Same as before: I also get it from a rspec-rails case... ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] BDD for C#?

2009-04-25 Thread Phlip
't know C#, but I could do it in C++ in a couple days. -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-25 Thread Phlip
_ext.rb:79:in `parse_or_fail' test/unit/cuke_test.rb:12:in `test_parser' 1 tests, 0 assertions, 0 failures, 1 errors -- Phlip http://flea.sourceforge.net/resume.html ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-25 Thread Phlip
Phlip wrote: aslak hellesoy wrote: Try this: require 'cucumber' Cucumber.load_language('en') p = Cucumber::Parser::FeatureParser.new f = p.parse_or_fail <<-EOF Feature: Foo Scenario: Bar Given Zap EOF Aslak Nope! Exact same error. Should I get the benc

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-25 Thread Phlip
aslak hellesoy wrote: Try this: require 'cucumber' Cucumber.load_language('en') p = Cucumber::Parser::FeatureParser.new f = p.parse_or_fail <<-EOF Feature: Foo Scenario: Bar Given Zap EOF Aslak Nope! Exact same error. Should I get the bench version? (It

[rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-24 Thread Phlip
lib/cucumber/parser/feature.rb:106:in `_nt_feature' cucumber (0.3.0) lib/cucumber/parser/feature.rb:102:in `loop' ... Okay, how do I just whip out the parser and have it parse raw Cuke code? -- Phlip http://flea.sourceforge.net/resume.html ___

Re: [rspec-users] Why RSpec?

2009-04-22 Thread Phlip
cases don't need it, or duplicating 'specific' into two test cases, or merging the 'specific' setup into a global 'assemble_specific' method yadda yadda yadda. Nesting the contexts lets them share their setups, so the contexts are much easier to mix and match. --

Re: [rspec-users] [RSpec] rcov and/or rexml bug?

2009-04-16 Thread Phlip
aslak hellesoy wrote: How can I uninstall a manually installed spicycode-rcov gem? I'd like to install it using the rubygems management tool. gem --help gem help commands gem uninstall spicycode-rcov I thought he meant ruby setup.rb installed it. I would either find it and yank it ou

Re: [rspec-users] How to test/spec an ActiveRecord find that uses :include

2009-04-15 Thread Phlip
res have illustrated how you can leverage the database for a pool of stub objects. It doesn't lead to bad design, or slow tests down. -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to write a feature that calls for a prompt?

2009-04-14 Thread Phlip
Colfer, Brian wrote: I am writing a feature that will test an LDAP protected site. I need to login as my self with my real password. When unit testing, thou shalt not hit the wire. Mock anything that goes further than your database. Put another way, you are not going to refactor LDAP itself

Re: [rspec-users] Mocking: brittle specs and tight coupling?

2009-04-12 Thread Phlip
Zach Dennis wrote: My current day-job's most important project has a test suite that suffered from abuse of that concept. The original team, without enough refactoring, were cloning and modifying very-high-level tests, making them longer, and using them to TDD new features into the bottom of the

Re: [rspec-users] Mocking: brittle specs and tight coupling?

2009-04-12 Thread Phlip
es Kanze's over-educated arguments against TDD: Phlip wrote: James Kanze wrote: > In particular, you can't > write a single line of code (unit test or implementation) before > you know what the function should do, I didn't bring up TDD, but if you are curious enough about i

Re: [rspec-users] Mocking: brittle specs and tight coupling?

2009-04-12 Thread Phlip
The third alternative is you never _need_ to mock, yet both your tests and target code are highly decoupled. _That_ is the goal. Another tip: To TDD a new feature, don't clone a high-level test which calls code which calls code which calls the code you need to change. Start by cloning the low

Re: [rspec-users] Mocking: brittle specs and tight coupling?

2009-04-11 Thread Phlip
simple test, and the angle between the chopsticks represents the _difference_ between the two tests. If each test is simple yet is set up differently, then the simplest code which can pass both simple tests approaches the most elegant design. Mock abuse just enable

Re: [rspec-users] where's an example of an RSpec'd Rails or Merb site with RJS calls?

2009-04-10 Thread Phlip
The time has come to plug assert_rjs_ into a matcher providing a grammar like "should generate_js_to :replace_html...". Does anyone have a lite website that uses Ajax and RSpec, for a reference implementation? I need non-trivial challenges... Whoa - this'n sure hit the spot! http://github.

[rspec-users] where's an example of an RSpec'd Rails or Merb site with RJS calls?

2009-04-10 Thread Phlip
RSpeckers: The time has come to plug assert_rjs_ into a matcher providing a grammar like "should generate_js_to :replace_html...". Does anyone have a lite website that uses Ajax and RSpec, for a reference implementation? I need non-trivial challenges...

Re: [rspec-users] Eliminating duplication from tests

2009-04-10 Thread Phlip
Brandon Olivares wrote: So is this necessarily bad? I've heard it's not always good to reduce duplication in tests, but it just seems much preferable than copy/paste. Refactor production code (while passing the tests after each edit) to make it as DRY as possible. This _typically_ means dupli

Re: [rspec-users] Eliminating duplication from tests

2009-04-10 Thread Phlip
Brandon Olivares wrote: Oh, and that described_class trick is great; thanks for showing me that. http://c2.com/cgi/wiki?AbstractTest ? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing helpers that accept a block

2009-04-08 Thread Phlip
assert_xhtml output do div.error do p 'Block' end end Nokogiri has some "easter eggs" in its ambitious HTML::Builder system. One of them is only HTML tags not already recognized as methods can get turned into HTML tags. The usual .method_missing(

Re: [rspec-users] spec'ing theme views

2009-04-07 Thread Phlip
David Chelimsky wrote: it "should render" do template.view_paths=(File.join(File.dirname(__FILE__), "/../../../themes/my_theme/")) render end And why isn't that DRY with the matching /../../../themes code on the production side? Because nobody has asked for support for views outside the

Re: [rspec-users] spec'ing theme views

2009-04-06 Thread Phlip
David Chelimsky wrote: Try this: describe "/default/index.html.erb", :type => :view do include DefaultHelper it "should render" do template.view_paths=(File.join(File.dirname(__FILE__), "/../../../themes/my_theme/")) render end And why isn't that DRY with the matching /../../../them

Re: [rspec-users] JSON matcher

2009-04-06 Thread Phlip
Michael Schuerig wrote: def failure_message "expected\...@raw_target}\n" + "to be JSON code equivalent to\...@raw_expected}\n" + "Difference:\...@expected.diff(@target).inspect}" end Nice - this fixes the common problem with assertions on large bulky variabl

Re: [rspec-users] a wiki to host Cuke & webrat?

2009-04-06 Thread Phlip
John Goodsen wrote: I never said it was done - you are supposed to help out Phlip! Verbiage issue - sorry! I didn't see a "plugin" here. I didn't "envision a plugin in this problem space". I didn't mean I didn't physically see one in your si

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-05 Thread Phlip
Brandon Olivares wrote: Is there any documentation of the rest of assert2? I found a web site I think (assuming it's the same thing), but there wasn't really documentation for assert_xhtml or assert_rjs. assert_rjs is still in the oven, and assert_xhtml arrived too fast to get anything more t

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-04 Thread Phlip
Brandon Olivares wrote: I'd appreciate it if you could let me know about the be_html_with issue when you can though, as I like the natural language better. Add this monkey patch below require 'assert2/xhtml': class BeHtmlWith def matches?(stwing, &block) @block ||= block @scope.wrap

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-04 Thread Phlip
Brandon Olivares wrote: Yes that's great! That works perfectly. I'd appreciate it if you could let me know about the be_html_with issue when you can though, as I like the natural language better. i dunno about "natural language", but I expect to fix the RSpec language this weekend. (-; ___

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-04 Thread Phlip
Brandon Olivares wrote: it "should have a name field" do response.body.should be_html_with { form.contact! do label 'Name' input.name! end } end # it "should have a name field" There is most definitely not a name field, nor

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-04 Thread Phlip
Brandon Olivares wrote: I just found a custom matcher created by Phlip at http://gist.github.com/76136 That's just a sketch. The real deal is at... gem install nokogiri assert2 require 'assert2/xhtml' Report if that works better. You might find its inside source code is

Re: [rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks

2009-04-04 Thread Phlip
Uh oh. select! :id => 'subject' select!.subject! ! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] a wiki to host Cuke & webrat?

2009-04-03 Thread Phlip
John Goodsen wrote: this was my vision with rcumber - I haven't worked on it for a few months, but it's basically a rails plugin that provides a web interface to edit and run cucumber tests I'd love some help and ideas from others to take this to a more universally usable tool - we use it

[rspec-users] a wiki to host Cuke & webrat?

2009-04-02 Thread Phlip
nd I could get them working very easily in a lite wiki using only Rails & Ajax. They would run on any platform, without special JS or plugins... -- Phlip http://www.zeroplayer.com/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyf

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
David Chelimsky wrote: Or, conversely, autotest is awesome if you take the time to learn how to use it: http://blog.davidchelimsky.net/2008/3/5/limiting-scope-of-autotest Even with -f, after it ran our most recently changed test... ...it started the grand wazoo test batch. Pass! I can just

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
aidy lewis wrote: What editor are you then proposing? Or are you saying that all current editors lag behind XP practices? http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html ___ rspec-users mailing list rspec-users@rubyfo

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
Fernando Perez wrote: As a habit I like to abuse of the save button even if I only corrected some typos in comments, or changed the indentation. Suddenly autotest would kick in for nothing. Autotest sucks. If we have too many tests, it runs them all, and this slows us down. Our editor suppo

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
f things look good, and always before updating the code on the server. But you should _want_ to test every few edits. More important, you should be able to correctly predict the result of each run. -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] [ANN] assert2-0.4.6 provides assert_xhtml, an alternative to assert_select

2009-03-26 Thread Phlip
better diagnostics. Until they work, if these diagnostics are not sufficient, put :verbose! on the lowest element you think works, and comment out its contents... === RSpec === The matching "specification", in RSpec language, is be_html_with{}. Its syntax and behavior are the same: it 'should have a cute form' do render '/users/new' response.body.should be_html_with{ form :action => '/users' do fieldset do legend 'Personal Information' label 'First nome' input :type => 'text', :name => 'user[first_name]' end end } end Good hunting! -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] have_tag and img's

2009-03-20 Thread Phlip
3/image' input :type => :hidden, :name => :captcha_id input :name => :captcha end end I invented it specifically to solve the verbosity problem you encountered. gem install nokogiri assert2, and require 'assert2/xhtml

[rspec-users] [ANN] assert2/xhtml specifies your HTML by example

2009-03-16 Thread Phlip
hing you like inside the block, and if the assertion can't find it, it will explain why it can't. Install the gem like this: gem install nokogiri assert2 # make sure the later is 0.3.9! Then use require 'assert2/xhtml', in either the test/unit or RSpec environments.

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-15 Thread Phlip
to fix things? That means if you must make the assertion less strict, you should get a clue _how_ to make it less strict! maybe that gets you moving in the right direction. Don't make me tell you under what circumstances I learned graph theory. (-: -- Phlip

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-15 Thread Phlip
Zach Dennis wrote: I didn't have the expectation that they were peers of each other, just that they both existed somewhere in a fieldset tag. Any helper or matchers used for spec'ing views should be as liberal as possible while still communicating enough about the semantics of the page for the e

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-15 Thread Phlip
skip a tag if its absence makes the reference "look different" from the sample. Hence, the test should require at least one of the tags that separate the two contexts... (BTW the common verbiage for chemical tests of analytes here is "sample" for the substance submitted f

Re: [rspec-users] Presentation Testing and CSS ids

2009-03-12 Thread Phlip
close that gap? -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec and prawn

2009-03-10 Thread Phlip
aa aa wrote: Hi, I've just started using prawn but am at a bit of a loss how to create my view specs for it. For example, my normal view spec has things like response.should have_tag("blah") or response.body.should =~ /something/ How do I do this with prawn output? How do prawn's own unit test

Re: [rspec-users] rspec and prawn

2009-03-10 Thread Phlip
script parser, parse it, and look for your details? (Note, too, that .should =~ is only a cheap approximation of parsing...) -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-09 Thread Phlip
I haven't tried it yet, but it does seem very useful. The project I'm focused on right now is all json all the time, so I don't personally have a real world case for this at the moment. Anybody doing an app w/ html views willing to try this out? I put it into my current project today (as a >coug

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-09 Thread Phlip
Pat Nakajima wrote: Has anyone tried this? is it useful? It looks interesting, though it could be confused for trying to exactly mimic the actual markup, not just specify interesting parts. It only specifies interesting parts. The gist writeup explained that, for example, it skipped ov

Re: [rspec-users] custom, nested HTML matchers in RSpec

2009-03-09 Thread Phlip
http://gist.github.com/76136 response.body.should be_html_with{ form :action => '/users' do fieldset do legend 'Personal Information' label 'First name' input :type => 'text', :name => 'user[first_name]' end end } Has anyone tr

Re: [rspec-users] Presentation Testing and CSS ids

2009-03-09 Thread Phlip
han one TR, for example, and your test should scrape them up and look at them, searching for their class is nice. Does anyone here allow their art departments to directly edit and check in html.erb files? I suppose that would change things! -- Phlip ___

[rspec-users] custom, nested HTML matchers in RSpec

2009-03-09 Thread Phlip
o the fault's context - not the whole page.) But... The samples are not indented! The specification's reference is all run together, and your page's sample is (unfortunately!) exactly the way your View system generated it. I have a question out to Nokogiri about this... -- Phlip http://www.zeroplayer.com/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
its operators and axes are always available _without_ more DSLization. Your remaining points are noted - the answers are either "violent agreement" or "then don't do it like that". Augmented by my next post! -- Phlip http://www.zeroplayer.com/ ___

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
would also permit :type => /e/, for those who want any type with an /e/ in it! -- Phlip http://www.zeroplayer.com/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
Zach Dennis wrote: response.body.should be_xml_with do form :action => '/users' do fieldset do legend "Personal Information" label "First name" input :type => 'text', :name => 'user[first_name]' end end end I like this a lot. Then it should be ".should be_html_with"..

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
er service system I call this topic "XPath can see around corners": http://www.oreillynet.com/onlamp/blog/2007/08/xpath_checker_and_assert_xpath.html We are using XPath to pin down several elements in a page, allowing the other elements to change freely, but forcing them to maintain their co

[rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
message restricted itself to the XHTML inside the tag. This is a major benefit when diagnosing a huge page that failed. (But also note that your HTML, like your code, should come in small reusable snippets, such as partials, and that these should get tested directly!) Soon I will upgrade thi

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Phlip
script/spec -b /path/to/spec.rb will give a full backtrace. You can also add --backtrace to your spec.opts. Cheers, Chris Yay! txkbye! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Phlip
that simple feature, simply picks the short trace, to emphasize its own .should lines that faulted. (Many's the time we have squinted at a humongoid stack trace from Rails, trying to see the difference between all the library code and our own lines!) -- Phlip http://www.oreillyne

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Phlip
Nope. Try 1/0 inside a sub-method - you won't get a stack trace to it, right? Usually it does: >> def foo >> 1/0 >> end => nil >> def bar >> foo >> end => nil >> bar ZeroDivisionError: divided by 0 from (irb):43:in `/' from (irb):43:in `foo' from (irb):46:in `bar' fr

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Phlip
def really_div_by_zero 1/0 end def div_by_zero really_div_by_zero end it 'should trace my stack' do div_by_zero end And that hits the correct line: ZeroDivisionError in 'Whatever should trace my stack' divided by 0 spec/blog_mind_map_spec.rb:192:in `/' spec/blog_mind_ma

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Phlip
Tero Tilus wrote: Line 192 contains neither a stray nil nor a method 'macro'. So what exactly _is_ there? Do you know that particular line causes (or noes not cause) the error? Test::Unit::TestCase said the error was ~20 layers deeper - but exactly below the same to_xml() call as RSpec i

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Phlip
The question is why did RSpec throw away the backtrace? Am I the first person in history to hit a programming error inside RSpec?? Nope, but this probably isn't one of them. I said it wrong. The complete venting goes "Am I the first person in history to use RSpec, and then hit a programming

[rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Phlip
mind_map_spec.rb:192: spec/blog_mind_map_spec.rb:11: Line 192 contains neither a stray nil nor a method 'macro'. The question is why did RSpec throw away the backtrace? Am I the first person in history to hit a programming error inside RSpec?? -- Phlip _

Re: [rspec-users] [rails] An authorization question

2009-03-02 Thread Phlip
We are no longer asking x if it exists. We are telling it what to do, and letting it decide how to do it. That is the heart of OO programming. (There is still an 'if', somewhere - the one that populates x. But - hopefully - it's only in one place.) -- Phlip

Re: [rspec-users] Is there a way to generate spec for existing controllers?

2009-03-01 Thread Phlip
erate specs for them. Nope. Sorry. Ask your goal-donor what feature they'd like to see in a spec. That is the point of specs - writing verbiage that a "product manager" or "business analyst" can review. -- Phlip ___ rspec-

[rspec-users] how to get started with cucumber and assert{ 2.0 }

2009-03-01 Thread Phlip
the reflector re-evaluates everything more than twice at fault time, and if you put your money-line inside a do-end block and it fails, the second re-evaluations might change their value and cause a confusing output! Ruby1.9, with its built-in Ripper, will proba

Re: [rspec-users] [Cucumber] pretty html output?

2009-02-25 Thread Phlip
.. BTW you can just copy styles out of Firebug, too, at least one block at a time! -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber] pretty html output?

2009-02-25 Thread Phlip
Ben Mabey wrote: http://github.com/bmabey/cucumber-pygments-lexer/tree/master You can get something like: http://www.benmabey.com/cucumber_on_github.html Nice! Will use! And could we make it ... cucumber colored? like cucumber.css probably does? (-:

[rspec-users] [Cucumber] pretty html output?

2009-02-25 Thread Phlip
Cucumberists (and RSpec Classic users ;): How can we convert a Cucumber feature file into HTML with syntax highlighting? Not the test-runner output; that's preprocessed so it does not match the input file... Tx! -- Phlip ___ rspec-users ma

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-24 Thread Phlip
999, so we will never know if it could have worked... (-: -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-24 Thread Phlip
Matt Wynne wrote: I take my laptop home on the bus through central London Got WiFi? -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-23 Thread Phlip
commenting out the tests, because we can't figure out how to pass them - even by reverting and trying again! So, in this degenerate case, we have saturation testing for all the low-level code methods, but we are missing the high-level view that Cuke ought to be providing... --

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-23 Thread Phlip
And work in one room, so if you know another pair is in the same module, you just holler to them to integrate as soon as possible, each time you do it. -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-23 Thread Phlip
27; keyword, right? Pass the cuke, take it out, integrate, and then it runs in your integration batch, right? -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-22 Thread Phlip
rm. So keep flying that flag of vigilance, there! -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [cucumber] Cucumber and CI

2009-02-22 Thread Phlip
ssing? That's a bad metric, exactly like excess inventory in a warehouse. -- Phlip ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [OT] Googled for 'cucumber page caching'

2009-02-21 Thread Phlip
Bart Zonneveld wrote: ...and found this as 4th result: http://www.cafepress.com/foodparadise/4708787 I have a husband named Dean Wormer at Faber. Still want to show me your cucumber? -- Marion Wormer ___ rspec-users mailing list rspec-users@

Re: [rspec-users] how to write nested XPath matchers

2009-02-16 Thread Phlip
The same error message for a stray nil: This attempt, calling simple_matcher directly, gives nearly the same nil: def be_xml_with_(&block) waz_xdoc = @xdoc simple_matcher 'yo' do |given, matcher| wrap_expectation matcher do assert_xhtml given # this works block

Re: [rspec-users] how to write nested XPath matchers

2009-02-16 Thread Phlip
s' FAILED You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.first ./spec/views/users/new.html.erb_spec.rb:50: line 50 is just this one: response.body.should be_xml_with do and yes the respons

[rspec-users] how to write nested XPath matchers

2009-02-16 Thread Phlip
have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.first ./spec/views/users/new.html.erb_spec.rb:50: So if I were to rescue my own AssertionFailedError, and pack it into a failure_message, wouldn't that effort

[rspec-users] [ANN] Merb Mind Maps - a tutorial on RSpec, GraphViz & a little Merb

2009-02-16 Thread Phlip
Netizens: Crispin & Gregory's new book, /Agile Testing: A Practical Guide for Testers and Agile Teams/, has a kewt "mind map" at the start of each chapter. It inspired me to find a way to use the "tag cloud" on a blog to draw a mind map of the posts, linked by their tags in common. The res

Re: [rspec-users] how to write complex matchers

2009-02-15 Thread Phlip
Yury Kotlyarov wrote: Phlip wrote: Yury Kotlyarov wrote: http://github.com/yura/howto-rspec-custom-matchers/ The project aims to encourage feedback on the best practices of creating custom expectation matchers and specs for them. Does it make sense? That just says it's a &qu

Re: [rspec-users] how to write complex matchers

2009-02-14 Thread Phlip
Yury Kotlyarov wrote: http://github.com/yura/howto-rspec-custom-matchers/ The project aims to encourage feedback on the best practices of creating custom expectation matchers and specs for them. Does it make sense? That just says it's a "project". One git clone later... It is a Rails 2.3

Re: [rspec-users] how to write complex matchers

2009-02-14 Thread Phlip
http://github.com/yura/howto-rspec-custom-matchers/ RSpec is a library ;-) Please try again: What is that source code drop. A website? A library? or something else? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mail

Re: [rspec-users] how to write complex matchers

2009-02-14 Thread Phlip
Yury Kotlyarov wrote: The major problem is fixed: http://github.com/yura/howto-rspec-custom-matchers/ Apologies if I missed something, but is that a howto or a library? Do I git it and run it to ... learn to customize matchers? ___ rspec-users mai

Re: [rspec-users] how to write complex matchers

2009-02-13 Thread Phlip
David Chelimsky wrote: This looks pretty cool. I wonder if you'd have any interest in making this a bit more rspec-friendly? Something like an option to run it like this: expect_xpath do It's on my do-list, but... ...are pluggable matchers as hard to write as the OP implied? How would you fi

Re: [rspec-users] how to write complex matchers

2009-02-13 Thread Phlip
'user[last_name]' end end From there, wrapping the xpath() calls up into kewt with_text_field() macros would be trivial. They could also absolves the redundant 'user[]' text on the names, for example. If any inner xpath() fails, there, the fault diagnos

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Phlip
FixtureDependencies into the round hole of Merb's RSpec. http://github.com/jeremyevans/fixture_dependencies/tree/master I can answer questions about it if anyone wants to try it. Except how to make it do rake db:fixtures:load. Does anyone know that one? --

[rspec-users] exemplary way to show a list is sorted?

2009-02-10 Thread Phlip
list.map(&:affinity) ...but it seems that the point of BDD is to make the business logic obvious, not obscured in programming details, right? -- Phlip http://www.oreilly.com/catalog/9780596510657/ ^ assert_xpath http://tinyurl.com/yrc77g <-- assert_latest Model _

Re: [rspec-users] undefined method `inherit' for Merb::Test::ExampleGroup

2009-02-03 Thread Phlip
David Chelimsky wrote: Spec::Runner.configure do |c| c.include MyMethods end Tx that was it! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] undefined method `inherit' for Merb::Test::ExampleGroup

2009-02-02 Thread Phlip
Pat Maddox wrote: I'll blame Merb on the basis that there is no "inherit" in RSpec. I'm guessing it's some kind of merb extension. http://blog.davidchelimsky.net/2007/4/1/rspec-plays-nice-with-others I know I know - time flies! If it has been superseded, then how do you inject a batch of as

  1   2   >