Re: [rspec-users] Specifying a Celluloid actor is still alive without a negative error expectation

2013-08-13 Thread Ash Moran
On 13 Aug 2013, at 13:16, Andy Lindeman wrote: > The problem with not_to raise_error is that it's a tad confusing. It > could be interpreted either that you meant no error at all to be raised, > or an error to be raised but not of the given type. Hmmm, I always interpreted it as "I don't care w

[rspec-users] Specifying a Celluloid actor is still alive without a negative error expectation

2013-08-13 Thread Ash Moran
Hi all I've recently become aware that `expect { … }.to_not raise_error(SomeError)` has been deprecated. I've found a few cases where this has been frustrating, but I've hit one I'm completely stumped by. I'm writing a Celluloid actor which invokes some user-provided procs with (separately)

Re: [rspec-users] Speeding up RSpec Tests

2013-02-14 Thread Ash Moran
On 13 Feb 2013, at 22:51, Adam Sroka wrote: > Why would you need to generate models with passwords for every spec? Why > would you need to generate a password for *any* spec that wasn't specifically > about authentication? > > It seems like hacking BCrypt is a way to avoid the design problem

Re: [rspec-users] Building higher-level DSLs

2013-02-08 Thread Ash Moran
On 7 Feb 2013, at 23:32, Sam Goldman wrote: > I'm not sure if this is what you are looking for, but I do have some > experience with writing DSLs on top of RSpec. > > I made a project that lets you write tests for HTTP APIs in a bit more of a > straightforward manner[1]. This isn't quite the l

[rspec-users] Building higher-level DSLs

2013-02-07 Thread Ash Moran
Hi Someone on another mailing list I'm on recently posted asking for people's thoughts on test naming practices, and writing my reply made me think about some of the techniques I use to improve naming and remove duplication in my own spec files. The most worked-through example I have is the co

Re: [rspec-users] where does cucumber.yml live?

2012-01-06 Thread Ash Moran
On 6 Jan 2012, at 23:03, Justin Ko wrote: > All I see is links to Cucumber. Maybe try the Cucumber mailing list? I'm curious - why after all these years do so many Cucumber-related issues still get posted on the RSpec list? Is there an outdated FAQ lurking somewhere? Ash -- http://www.patchs

Re: [rspec-users] Write tests for objects with lots of dependencies

2011-11-29 Thread Ash Moran
On 8 Nov 2011, at 06:52, Romain Tribes wrote: > I'm writing a Risk-like webgame > (https://github.com/Sephi-Chan/Conquest-on-Rails) and I want to add tests, > but it's painful since objects have a lot of dependencies each other. Hi Romain I was just catching up on some old RSpec emails and fo

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-11-27 Thread Ash Moran
On 30 Aug 2011, at 14:45, Nikolay Sturm wrote: > * Ash Moran [2011-08-30]: >> I never thought of that! Yes, that could also work, probably better in >> fact. It just involves running multiple Guard processes, although >> there's Terminitor[1] for that! > > A si

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-23 Thread Ash Moran
On 23 Nov 2011, at 07:19, Andrew Premdas wrote: >>> Use Ruby 1.8.7 its much faster. There is a very good screencast on >>> Destroy All Software that might help also - the one about extracting >>> domain objects (or something like that). >> >> Anytime someone suggests using 1.8, a Chinchilla expl

[rspec-users] Rails code reloading in RSpec test environment?

2011-11-22 Thread Ash Moran
Hi I've worked on a couple of Rails 3 apps recently and the test feedback loop is killing me. With no modifications, it takes 15-25 seconds to run a single example. I've avoided Spork so far, but I've tried Spin[1]. Spin shaves a few seconds off but it's still agonising. I've also experimented

Re: [rspec-users] rspec 2.7.0.rc1 is released!

2011-10-13 Thread Ash Moran
On 10 Oct 2011, at 15:22, David Chelimsky wrote: > Nope. Wanna add one? > > The basic idea is: > > shared_examples Enumerable do Aye, that's what I figured :-) I've wished for that for a long time. I'm away for a bit but I'll see if I get chance soon. Ash -- http://www.patchspace.co.uk/ h

Re: [rspec-users] rspec 2.7.0.rc1 is released!

2011-10-10 Thread Ash Moran
On 9 Oct 2011, at 21:23, David Chelimsky wrote: > * Allow classes/modules to be used as shared example group identifiers >(Arthur Gunn) This sounds awesome. Are there any full examples? I could only see unit tests in the code. Ash -- http://www.patchspace.co.uk/ http://www.linkedin.com/

Re: [rspec-users] let vs ivar w/ before block

2011-10-01 Thread Ash Moran
On 1 Oct 2011, at 00:36, Srushti Ambekallu wrote: > On 30/09/11 6:24 PM, Patrick J. Collins wrote: >> So regarding objects persisting over multiple examples-- I was told >> repeatedly >> by experienced RSpec peeps to not use before(:all)… > > I don't know if object creation (including the corr

Re: [rspec-users] Mocking expectations on I/O operations

2011-09-16 Thread Ash Moran
On 16 Sep 2011, at 01:17, Alex Chaffee wrote: > https://github.com/defunkt/fakefs might help too I thought that too, but then it occurred to me there's a chance mini_magick isn't using Ruby's filesystem code (it might be writing to the FileSystem with native code for example), so I didn't put

Re: [rspec-users] Mocking expectations on I/O operations

2011-09-15 Thread Ash Moran
On 15 Sep 2011, at 10:05, Rob Aldred wrote: > Thanks Justin, > That isnt working... its erroring with: > > The method `delete` was not stubbed or was already unstubbed Hi Rob For reasons I could go into, when I'm coding myself I don't usually stub out file system access or other third party

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-09-09 Thread Ash Moran
On 30 Aug 2011, at 14:45, Nikolay Sturm wrote: > * Ash Moran [2011-08-30]: >> I never thought of that! Yes, that could also work, probably better in >> fact. It just involves running multiple Guard processes, although >> there's Terminitor[1] for that! > > A si

[rspec-users] Selectively ignoring exceptions in examples

2011-09-01 Thread Ash Moran
Hi all Long time since I've posted here, hope you're all well :-) I have a question about ignoring exceptions when they're not interesting. For example, I have a few cases in my code along these lines… it "prints an error" do expect { run_command(%w[ missing_wallet.dat ])

Re: [rspec-users] Better visualizations of spec running time besides --profile?

2011-09-01 Thread Ash Moran
On 31 Aug 2011, at 23:06, John Feminella wrote: > We have about 2,000 specs in a Rails app that take roughly 80 seconds > to run, and I'm trying to improve the performance of things a bit. > > While the profile mode has proven useful so far, it only shows the top > ten slowest specs. Unfortunate

Re: [rspec-users] Getting Desired behaviour when I run the program, but spec still fails.

2011-08-31 Thread Ash Moran
On 31 Aug 2011, at 09:22, GB Hoyt wrote: > I'm not doing something right with the following spec and code: > https://gist.github.com/1183066 > > My problem lies in the last Spec: > > it "should load the contents of the text file into the action list" do > @menu.action_list.empty?.should == fals

Re: [rspec-users] Testing console IO / Re: Selectively ignoring exceptions in examples

2011-08-30 Thread Ash Moran
On 30 Aug 2011, at 19:24, Alex Chaffee wrote: > ...or grabbing and reassigning $stdout and $stderr, which is what > "capturing" does. > > The basic idea is that Ruby is *already* decoupled from stdin/out/err > via its dynamic nature and $globals. I get that by naming the inputs > explicitly you'

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-08-30 Thread Ash Moran
On 30 Aug 2011, at 14:45, Nikolay Sturm wrote: > A single guard process is enough, it will start all guards defined in > your Guardfile. I did not know that! I'm still new to Guard, a recent convert from Autotest. Thanks for the tip. Cheers Ash -- http://www.patchspace.co.uk/ http://www.link

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-08-30 Thread Ash Moran
On 30 Aug 2011, at 07:01, Nikolay Sturm wrote: > I have a similar situation with the slow specs being integration specs > in a special directory. I tagged all those example groups and setup two > guards. The first is for unit tests and ignores all examples tagged > 'integration' and doesn't watch

[rspec-users] Testing console IO / Re: Selectively ignoring exceptions in examples

2011-08-30 Thread Ash Moran
On 30 Aug 2011, at 00:09, Alex Chaffee wrote: > I do. So often that I wrote a helper and put it in Wrong. Cool, and also… I really should try Wrong! I've just put it on my project TODO list as something to investigate > I don't quite get what "stream_bundle.captured_error" is in your > example

[rspec-users] Selectively running slow specs on file change with Guard

2011-08-29 Thread Ash Moran
Hi all (again) Sorry for the new thread, but I don't have a copy of my own email in my inbox to reply to. Anyway I managed to cobble together a hack to make Guard filter slow specs by default, but unfilter them if the slow file itself was changed. I've Gisted the relevant sections of my Guardf

[rspec-users] Skipping slow specs in Guard but running them from that file

2011-08-29 Thread Ash Moran
Hi all I'm trying to optimise my spec run time. I have 123 examples so far, which run in ~4.2 seconds on average. But 116 of those will run in ~0.18 seconds. So, obviously, I only want to run the slow ones when I change that code. I've added `adapter: :slow` to the offending example group, whic

Re: [rspec-users] Selectively ignoring exceptions in examples

2011-08-29 Thread Ash Moran
On 29 Aug 2011, at 20:09, Nick wrote: > Hey there, Ash. Why not put your call to #run_command inside a begin-rescue > statement? Hi Nick Yes I'm missing the obvious as usual* :-) Well I guess I could, but the syntax then is even more intrusive. I guess I just want the lightest way possible t

[rspec-users] Selectively ignoring exceptions in examples

2011-08-29 Thread Ash Moran
Hi all Long time since I've posted to rspec-users. Glad to see the place is still here and hope you're all well :-) I have a question about ignoring exceptions when they're not interesting. For example, I have a few cases in my code along these lines… it "prints an error" do expect {