Re: [rspec-users] Testing .Net Newbie

2010-01-15 Thread Joaquin Rivera Padron
hey there
there's also http://bddcasts.com with railscasts like bdd screencasts

haven't check it much myself, but might deserve a look

hth,
joaquin

2010/1/14 Ashley Moran 

>
> On Jan 14, 2010, at 1:17 pm, John Polling wrote:
>
> > I think this is the part that I'm confusing myself with as most Cucumber
> > information talks about using scenarios to drive the code out.  So
> > Cucumber comes first, whereas I used to do the Acceptance testing after
> > all the other TDD stuff.  Maybe that is me doing it wrong though.
>
> The book David mentioned earlier - before the one he wrote himself :) -
> GOOS[1] has a diagram on p40 that shows how the unit test cycle fits inside
> the acceptance test cycle.  You can extend this to as many layers as you
> like.  I wrote a blog post which has a pretty picture of the idea[2].
>  Ignore the text, it's long and rambling and is about something else.  I
> thought it was a great insight, until I realised Kent Beck wrote about
> self-similarity something like 5+ years ago[3].
>
> Ashley
>
>
> [1]
> http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627
> [2]
> http://blog.patchspace.co.uk/2009/12/customers-input-and-russian-doll-of.html
> [3]
> http://www.goodreads.com/book/show/67833.Extreme_Programming_Explained_Embrace_Change
>
> --
> http://www.patchspace.co.uk/
> http://www.linkedin.com/in/ashleymoran
>
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
www.least-significant-bit.com
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing .Net Newbie

2010-01-15 Thread Diwakar, ANGLER - EIT


Good explanation Phillip. It gives a clear idea...

Thanks

Regards,
Diwakar


Others can explain it better than me (and have), but in a nutshell:

- use Cucumber for full stack (as the user would see it) testing. Some
call it User Acceptance Testing (UAT)
- use RSpec for unit/functional testing (controllers, models, views,
helpers)

I think of it like this: RSpec is for the developer, Cucumber is for the
user. That may be a gross oversimplification, but it works for me. :)
But one thing to keep in mind is that you can (and maybe should) use
them together. Through Cucumber, you establish the context of what the
user will expect. Through RSpec, you establish expectations for the
different pieces of the application. That's why it's called "Outside In
Development": You start with the outside of the black box (what the user
interacts with) and then step into the black box (the nuts and bolts
that the user doesn't care about, but you, the developer, do).

Yes, it will come with experience. Just be patient, learn from your
mistakes, and ask lots of questions! That you have testing knowledge
already will help. Once the RSpec/Cucumber light goes on, there will be
no stopping you!

Peace,
Phillip
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] autospec: non-standard filenames & redirecting output

2010-01-15 Thread David Chelimsky
On Thu, Jan 14, 2010 at 10:10 PM, DeNigris Sean wrote:

> Rspec gurus,
>
> I have 2 questions about autospec.  I've played around quite a bit, but
> can't figure it out...
>
> 1.  I got autospec to work with my directory structure
> ("examples/*_example.rb"), but it only works if I have an empty spec/
> directory.  Otherwise it reverts to running tests instead of examples...
> Current ./.autotest:
> Autotest.add_discovery do
>  "rspec" if File.directory?('examples')
> end
>

If you crack open ZenTest and look at these files:

bin/autotest
lib/autotest.rb

you'll see (eventually) that ./.autotest is loaded too late in the process.
It's actually loaded during the initialization of an Autotest object (or
subclass), so the class must already be determined.

Per the docs for autodiscover, all autotest/discover.rb files on your path
are loaded in order to determine what file to load. Try adding an autotest
directory in your project with a discover.rb file in it with:

Autotest.add_discovery { "rpspec" }


> Autotest.add_hook(:initialize) {|at|
>  ##at.add_exception %r{^\.git}  # ignore Version Control System
>  at.clear_mappings # take out the default (test/test*rb)
>
>  at.add_mapping(%r%^examples/.*_example.rb$%) { |filename, _|
>filename
>  }
>  at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
>["examples/#{m[1]}_example.rb"]
>  }
>  at.add_mapping(%r%^examples/(example_helper|shared/.*)\.rb$%) {
>at.files_matching %r%^examples/.*_example\.rb$%
>  }
>nil
> }
>
> 2.  Does anyone have a technique for redirecting the output (in my case to
> MacVim)?  I really only want it to happen if there are errors.  If
> everything went smoothly, probably a growl notification would be easier.
>

I'm not sure about redirecting to MacVim, but I do use growl notifications
for success and failure. If there's a failure, I go look at the shell
output. FWIW.

HTH,
David


>
> Thanks!
>
> Sean DeNigris
> s...@clipperadams.com
>
> Mac OS X 10.6.2
> rspec 1.2.9
> ZenTest 4.2.1
>
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] default to just call the method?

2010-01-15 Thread Ashley Moran

On 14 Jan 2010, at 17:02, Rick DeNatale wrote:

> -1
> 
> You can already say
> 
> a.should include("1:4")
> 
> which is clearer IMHO.


I assume Roger was referring to the general case though (which I still don't 
like) - and just happened to pick an example with an existing matcher.

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran



___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users