Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/9/25 Mithun Perera > Mithun Perera wrote: > > Mithun Perera wrote: > >> Hi all, > >> I am an university student and these days i am on training period. So i > >> want to know about ruby on on rails "cucumber and Rspec". If somebody > >> know about these fields please help me. If not please s

Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/10/7 aslak hellesoy > > > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas wrote: > >> 2009/9/25 Mithun Perera >> >>> Mithun Perera wrote: >>> > Mithun Perera wrote: >>> >> Hi all, >>> >> I am an university student

Re: [rspec-users] Need Help

2009-10-07 Thread Andrew Premdas
2009/10/7 David Chelimsky > On Wed, Oct 7, 2009 at 3:57 PM, aslak hellesoy > wrote: > > > > > > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas > wrote: > >> > >> 2009/9/25 Mithun Perera > >>> > >>> Mithun Perera wrote: >

Re: [rspec-users] spec-ing private methods?

2009-10-15 Thread Andrew Premdas
2009/10/14 Joaquin Rivera Padron > hello there, > how do you tipically spec private methods? The thing is Ï have something > like this: > > def some_method >complex_method + other_complex_methods > end > > private > def complex_method... > def other_complex_methods ... > > and the two complex

Re: [rspec-users] spec-ing private methods?

2009-10-15 Thread Andrew Premdas
2009/10/15 Stephen Eley > On Thu, Oct 15, 2009 at 3:59 AM, Andrew Premdas > wrote: > > > > You can take this further and state that no public method should ever do > > anything, it should just contain calls to private methods which document > how > > the public

Re: [rspec-users] Rspec - In views

2009-10-28 Thread Andrew Premdas
2009/10/28 Rails ROR > Hi All, > > I want to test my application with rspec. > > In order to test my views, I have written few specs as given in the > examples. > > Is there any way to test the user acceptance? > > i.e suppose the field takes a string. > > I want to test it for integers, float va

Re: [rspec-users] [BDD] View specs and cucumber -- duplication of effort?

2009-11-04 Thread Andrew Premdas
2009/10/29 nruth > Hi Guys > > I'm going to put the cat amongst the pigeons here in the hope of some > clarity falling out of the sky on me. > My question is this: In a world with Cucumber what is the value of > view specs? > > In the community (railscamp, for example) there are a fair number of

Re: [rspec-users] [BDD] View specs and cucumber -- duplication of effort?

2009-11-04 Thread Andrew Premdas
2009/11/4 Stephen Eley > On Wed, Nov 4, 2009 at 10:56 AM, Andrew Premdas > wrote: > > > > Putting lots of > > view details in the features (and I should see a wibble field etc. ...) > > pollutes this map with clutter that is not relevant to the "business"

Re: [rspec-users] [BDD] View specs and cucumber -- duplication of effort?

2009-11-07 Thread Andrew Premdas
2009/11/5 Chuck van der Linden > On Nov 4, 5:30 pm, David Chelimsky wrote: > > On Wed, Nov 4, 2009 at 3:36 PM, Stephen Eley wrote: > > > On Wed, Nov 4, 2009 at 3:24 PM, Andrew Premdas > wrote: > > > > > > Personally I now think nested steps are evil - bu

[rspec-users] Spec helper configuration problem

2009-11-27 Thread Andrew Premdas
Hi all, I have a rails application whose specs run on about eight different boxes, but I can't get them to work on my integration server. The bit thats breaking concerns some modules that I have in spec/support/modules which are loaded by the following line in spec_helper # get any macros etc

Re: [rspec-users] Spec helper configuration problem

2009-11-30 Thread Andrew Premdas
2009/11/27 Ben Mabey > Andrew Premdas wrote: > >> Hi all, >> >> I have a rails application whose specs run on about eight different boxes, >> but I can't get them to work on my integration server. The bit thats >> breaking concerns some modules that

Re: [rspec-users] [rspec-rails] spec vs. autospec

2009-12-05 Thread Andrew Premdas
2009/12/4 Andy Koch > Hi All, > > any reason why some tests might pass via spec ... and fail from within > autospec? > > I have a rails app using AuthLogic and Declarative Authorization. I > have tests that create user_sessions and assign roles against which > CRUD rules are tested. > > This has

Re: [rspec-users] undefined method `route_for

2009-12-14 Thread Andrew Premdas
2009/12/14 Amit Kulkarni > Thanks David. > Also i am little bit confused regarding routes. > > Consider a routing example > > it "should map { :controller => 'channels', :action => 'new' } to > /channels/new" do > route_for(:controller => "channels", :action => "new").should == > "/channels/new"

Re: [rspec-users] class variables different between spec and runtime?

2009-12-27 Thread Andrew Premdas
2009/12/22 Rick DeNatale > On Tue, Dec 22, 2009 at 10:24 AM, David Chelimsky > wrote: > > > > > > On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky > > wrote: > >> > >> > >> On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons > >> wrote: > >>> > >>> Hello Folks, > >>> > >>> This gist http://gist

Re: [rspec-users] more verbosity for be_an?

2010-01-02 Thread Andrew Premdas
2009/12/30 rogerdpack > > What about something like: > > > > expected # => Fixnum to be a kind of Fixnum > > > > That is more aligned with other failure messages. WDYT? > > I quite like it. > In this instance it was > > 3.class.should be_a Fixnum # fails > > I suppose it would be something like

Re: [rspec-users] more verbosity for be_an?

2010-01-03 Thread Andrew Premdas
2010/1/3 rogerdpack > > > The very first test I thought up was "this method should return an > > > integer" so kind of a basic test for a not yet existent method. > > > > Isn't this a bit anti-ruby though. Surely the things we should be testing > is > > that the object exists, responds to certain

Re: [rspec-users] more verbosity for be_an?

2010-01-03 Thread Andrew Premdas
2010/1/2 David Chelimsky > > > On Sat, Jan 2, 2010 at 3:23 PM, Andrew Premdas wrote: > >> 2009/12/30 rogerdpack >> >> > What about something like: >>> > >>> > expected # => Fixnum to be a kind of Fixnum >>> > >>&g

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread Andrew Premdas
2009/12/30 Paul Hinze > Given this simple cucumber feature (related to another rspec bug I am > working on): > > http://gist.github.com/266335 > > I'm fighting with this error messages that _only_ shows up in certain > situations that I can't quite pin down (rake features breaks, individual > cu

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-05 Thread Andrew Premdas
2010/1/4 David Chelimsky > On Mon, Jan 4, 2010 at 2:57 PM, Andrew Premdas wrote: > >> 2009/12/30 Paul Hinze >> >> Given this simple cucumber feature (related to another rspec bug I am >>> working on): >>> >>> http://gist.github.com/266335

Re: [rspec-users] get to a different controller

2010-01-07 Thread Andrew Premdas
2010/1/7 Phillip Koebbe > > > Wincent Colaiuta wrote: > >> >> Well, there is more than one way to skin a cat, but the thing I like about >> my proposed solution is that: >> >> - the specification of the behavior appears in the "describe" block that >> corresponds to the controller where the behav

Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Andrew Premdas
On 31 January 2010 22:02, Nick Hoffman wrote: > One of my controller actions sends a redirect if the request URI begins > with /foods/search > > 34 def search > 35return redirect_to "/#{params[:name]}" if > request.request_uri.match /^\/foods\/search/ > > Unfortunately, I can't figure out

Re: [rspec-users] Do you still Write Tests First on code that is churning hard?

2010-02-21 Thread Andrew Premdas
On 19 February 2010 08:59, Erik Pukinskis wrote: > Hello Specmeisters! > > I have a bit of a philosophical question for the TDD witches and > wizards out there. I'm working on some code that is really > churning... It's doing complicated calculations, but the actual > desired results are a movin

Re: [rspec-users] Best practices to managing RSpec code for very large projects?

2010-03-09 Thread Andrew Premdas
On 4 February 2010 05:12, David Mitchell wrote: > Hello group, > > I've searched through several months messages in the archive, but haven't > found an answer to this... > > What is the 'best practice' way to structure RSpec code and documentation > when testing a very large project, where the RS

[rspec-users] old crumbly rspec

2010-05-24 Thread Andrew Premdas
Hi List, Being pretty lazy here, but I figure you can help very quickly and others might benefit from the results. I write old crumbly rspec (see gist http://gist.github.com/411689), and I would like to improve, can you take my crumbly spec and make it shiny? Also if you can post any links to rec

Re: [rspec-users] [CUCUMBER] Noob question

2010-05-26 Thread Andrew Premdas
On 25 May 2010 18:50, Pito Salas wrote: > Meta question: is this the right/best place to ask for assistance with > Cucumber or am I in the wrong place? > > Anyway, here goes. I just started using cucumber and it's very > impressive! > > Check out this fragment: > > And I go to the home page > The

Re: [rspec-users] [OT] programming (OOP) principles resources

2010-06-10 Thread Andrew Premdas
Link doesn't work typo? On 10 June 2010 10:43, Julian Leviston wrote: > I'm not so sure "We all know good principles of OOP" actually. > > I'd recommend www.vpri.com.au and looking into the work of Alan Kay. A lot > of his stuff can be found for free online, because it's decades old. > > Julian

[rspec-users] RSpec uses at_exit - forks and stuff

2010-07-07 Thread Andrew Premdas
Hi there. My understanding (which is limited) is that rspec uses at_exit to run its specs. I don't really know why - could somoene explain? My problem with this behaviour is that I would like the running of a spec to start an instance of solr (using Sunspot) if one is not running. The problem wit

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread Andrew Premdas
On 8 July 2010 01:01, David Chelimsky wrote: > On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: > > > Hi there. > > > > My understanding (which is limited) is that rspec uses at_exit to run its > specs. I don't really know why - could somoene explain? > &

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread Andrew Premdas
On 8 July 2010 11:46, David Chelimsky wrote: > On Jul 8, 2010, at 4:24 AM, Andrew Premdas wrote: > > On 8 July 2010 01:01, David Chelimsky wrote: > >> On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: >> >> > Hi there. >> > >> > My understandi

[rspec-users] 'its' not working

2010-07-21 Thread Andrew Premdas
trying out new syntax from jon larkowski's rspec presentation. Following doesn't work in that when I run the line from the command prompt or from textmate no specs are run context "cancel" do subject do order = at_dropshipping order.cancel_dropship! order end its(:

Re: [rspec-users] 'its' not working

2010-07-22 Thread Andrew Premdas
On 21 July 2010 17:06, David Chelimsky wrote: > On Jul 21, 2010, at 10:09 AM, Andrew Premdas wrote: > > > trying out new syntax from jon larkowski's rspec presentation. Following > doesn't work in that when I run the line from the command prompt or from &g

Re: [rspec-users] Testing initialize methods and chained methods

2010-10-19 Thread Andrew Premdas
Set an expectation that do_something should be called once. Then create a new Foo. With the method chain set an expectation that your chained method should be called, then call the original method. You should be able to check that the original method is passed as a param. Further information in R

Re: [rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Premdas
On 30 October 2010 14:40, Andrew Wagner wrote: > Ok, so here's the scenario. I have a top-level module, with a method called > load_file. It should take a file name, get the YAML module (Syck) to parse > it, and then send the result to a class, which should convert that result > into a series of

Re: [rspec-users] "unit" vs. "functional" specs

2010-12-19 Thread Andrew Premdas
When doing BDD, especially at the start, I found it really easy to write more code than you need to, when implementing a particular functional spec. I also found it really easy to miss the point where you should move into the inner cycle (unit cycle). Using the unit test coverage metric to make su

Re: [rspec-users] Testing html email content with have_selector rspec2 rails3 fails

2010-12-20 Thread Andrew Premdas
Rob, This doesn't make sense 1. None of your examples here are using have_selector ! 2. Why is OrderMailer no longer creating a receipt 3. Why is @mailer being encoded Is mailer.body the same in both versions, can you show this. Have you tried using a debugger before the first have_tag line. A

Re: [rspec-users] Feedback Requested (pretty please)

2011-01-21 Thread Andrew Premdas
for Jamis Buck's fat model skinny controller blog post, make your controllers do as little as possible and put all logic in the model. Then use rspec to test the public methods in your model. This will give you a much shallower learning curve, and be much more productive

Re: [rspec-users] major release required?

2011-01-21 Thread Andrew Premdas
rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > Whilst its very noble to try and follow the ruby gems document to the letter, some consideration has to be given to the overall effect of rapidly changing major version numbers on the project. RSpec has a very large user base, a close tie in with Rails major versions, in particular the idea to Rails 3 should use RSpec 2, and a history of changing major versions very infrequently with major consequences to the vast majority of users. This I think is a fair assessment of RSpec's context re version numbers. To move to RSpec 3, for such a small change would be completely out of character for the project. To end up in 4 months time with RSpec 9 would be very detrimental to the projects reputation. So I think the pragmatic approach is a minor release with a big caveat in the history and a big announcement on the mailing list All best Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] 'require'ing files from other directories

2011-01-21 Thread Andrew Premdas
all require. In the code above, you're pushing the lib directory onto the > load path. > > > The require statement I ended up using is > > > > require 'codebreaker/game' > > Maybe the lib/codebreaker file was supposed to do that? > > It should, mine

Re: [rspec-users] Best Practice for Controllers

2011-01-21 Thread Andrew Premdas
controllers in the namespace inherit from it. Something like: > > https://gist.github.com/784363 > > Doing it this way does create seeming duplication in the views, but > partials can be used very easily to deal with that. This method also > more or less demands a menu structure that completely separates the > functionality of each role, but in the projects that I've been working > on, that has been a benefit. To have all of the role-based > functionality separated in controllers and menus has provided clear > lines that are easy to follow. In short, it has worked out really > well. But, as always, your own mileage may vary. > > Peace. > Phillip > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > +1 for the many controllers for one model pattern, you can really simplify controllers with this approach. Having a separate view hierarchy for each of these controllers also makes for simpler views, with less logic. However you have be very disciplined with your view partials, or the number of files can get a bit confusing All best Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] major release required?

2011-01-22 Thread Andrew Premdas
]On 22 January 2011 09:47, David Chelimsky wrote: > On Fri, Jan 21, 2011 at 5:13 PM, Andrew Premdas > wrote: > > On 21 January 2011 13:56, David Chelimsky wrote: > >> > >> On Jan 19, 2011, at 6:48 AM, Rick DeNatale wrote: > >> > >> > On Tue, J

Re: [rspec-users] Fixtures not loading when running full test suite

2011-01-28 Thread Andrew Premdas
o with mysql not resetting its numbering between tests, so it is actually loading a user, but not with ID=1. I'm pretty sure I've seen that behaviour in the past. All best Andrew ___ > rspec-users mailing list > rspec

Re: [rspec-users] Cucumber and rspec, do cucumber step definitions use rspec?

2011-05-09 Thread Andrew Premdas
s) behaviour. The best place to see how they work in tandem is the RSpec Book. All best Andrew ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- ---

Re: [rspec-users] Problems installing rspec 2.6

2011-05-24 Thread Andrew Premdas
follow that do you get the same error? If so can you gist the following rvm --version ruby --version gem list --local Perhaps you need to update rvm, or revert it back? HTH Andrew ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Writing a spec for HTTP OPTIONS verb

2011-05-24 Thread Andrew Premdas
___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Writing a spec for HTTP OPTIONS verb

2011-05-24 Thread Andrew Premdas
(0 bytes > 0.09s) > => # @http_response=#> > ruby-1.9.2-p180 :002 > response.body > => nil > > Interestingly, that same uri does actually have a body when invoked with a > get. > > Best, > Sidu. > http://c42.in > http://about.me/ponnappa > >

[rspec-users] Migrating cucumber tm_bundle to rspec 2

2011-06-03 Thread Andrew Premdas
still getting errors, although it could be something unrelated TIA Andrew -- -------- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Migrating cucumber tm_bundle to rspec 2

2011-06-04 Thread Andrew Premdas
On 3 June 2011 15:17, David Chelimsky wrote: > On Jun 3, 2011, at 7:39 AM, Andrew Premdas wrote: > > > Hi there, > > > > I need some help migrating some code in the cucumber textmate bundle so I > can run the specs with rspec2. > > > > The following code l

Re: [rspec-users] Request for comments: Scenario

2011-06-05 Thread Andrew Premdas
th spec_helper 3. No explanation of where files should be put (in spec folder?) 4. I think the fixtures section could be fleshed out a bit with an example HTH Andrew > ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-use

[rspec-users] rspec with debug does not pick up .rdebugrc settings

2011-06-08 Thread Andrew Premdas
Hi there, latest rspec2, running in debug mode, does not seem to pick up settings from project .rdebugrc or home ~/.rdebugrc. Wondering if others experience this and if its anything obvious TIA Andrew -- Andrew Premdas blog.andrew.premdas.org

Re: [rspec-users] How to mock when there seems to be a requirement for chained mocked calls?

2011-06-14 Thread Andrew Premdas
ervable behavior of a model without > mocking its internals. This is _not_ the same as setting expectations on > model methods called from controllers, in which case we're specifying how > one component (the controller) talks to another component (the

[rspec-users] --profile and ci

2011-07-27 Thread Andrew Premdas
--profile is not a formatter (its not a formatter in I'm using Jenkins for Ci and rspec2, on a rails app TIA Andrew -- -------- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rub

Re: [rspec-users] How should I interpret RCov, code coverage?

2011-08-25 Thread Andrew Premdas
roblem, but it does not tell you what the problem is. Using multiple metrics and viewing them over time will give you many indicators of possible problems with a project. Properly identifying a problem, with enough precision to have a chance of implementing solutions for it, requires the investigation

Re: [rspec-users] Tests that require a logged in user / session cookie

2011-08-25 Thread Andrew Premdas
t; ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > If you are using Cucumber (which is in your minimal set of Gems), you don't need to write this sort of test. A Cucumber fea

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

2011-08-31 Thread Andrew Premdas
faster-start-up-time/ > -- > John Feminella > Principal Consultant, BitsBuilder > LI: http://www.linkedin.com/in/johnxf > SO: http://stackoverflow.com/users/75170/ > ___ > rspec-users mailing list > rspec-users@rubyforge.org > htt

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

2011-09-15 Thread Andrew Premdas
ted in how that cleanup is implemented. If you want to specify how the cleanup works then make cleanup public - either in this class, or perhaps better yet in another class. e.g. describe "Cleanup.clean" it "should delete files" end ... end describe IconGenerator

Re: [rspec-users] rspec 1.3.2, Rails 2.3.14 - plugins not loading

2011-10-21 Thread Andrew Premdas
r.run(:set_load_path) end end HTH All best Andrew > > cheers, > Matt > > -- > Freelance programmer & coach > Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Hellesøy) > Founder, http://relishapp.com > +44(0)7974430184 | http://twitter.com/mattwynne > > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] rspec 1.3.2, Rails 2.3.14 - plugins not loading

2011-10-24 Thread Andrew Premdas
ng a new rails project with the same gemset (ideally using RVM) might help isolate the issue. Also publishing the error messages in a gist, or even publishing the whole project on Github might help. All best Andrew > thanks > jc > > On 21 Okt., 22:18, Lenny Marks wrote: >> On

Re: [rspec-users] rspec 1.3.2, Rails 2.3.14 - plugins not loading

2011-10-28 Thread Andrew Premdas
27;database_cleaner' > end > > removing the :require => ... lines seemed to fix the problem > > So you were right - it was all my fault ;) > > thanks for prodding me in the right direction. > > cheers > jc your welcome all best Andrew >

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

2011-11-22 Thread Andrew Premdas
t extracting domain objects (or something like that). HTH Andrew ps > > [1] http://jstorimer.github.com/spin/ > > -- > http://www.patchspace.co.uk/ > http://www.linkedin.com/in/ashmoran > > ___ > rspec-users mailing list > rspec-u

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

2011-11-22 Thread Andrew Premdas
On 23 November 2011 00:57, Justin Ko wrote: > > On Nov 22, 2011, at 4:52 PM, Andrew Premdas wrote: > >> On 22 November 2011 20:31, Ash Moran wrote: >>> Hi >>> >>> I've worked on a couple of Rails 3 apps recently and the test feedback loop >>&

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

2011-11-23 Thread Andrew Premdas
On 23 November 2011 10:54, Ash Moran wrote: > > 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 >>&g

Re: [rspec-users] oddness with messages_path

2011-11-28 Thread Andrew Premdas
altech.edu > ___________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-12-01 Thread Andrew Premdas
ers@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > I'm a moderator on the Cukes list. There are no outstanding messages awaiting moderation. I suggest you try again. Send your message to cu...@googlegroups.com All best Andrew -- And

Re: [rspec-users] cucumber is_admin? testing

2011-12-03 Thread Andrew Premdas
ther account? All best Andrew > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users -- -------- Andrew P

Re: [rspec-users] stub().and_raise() ain't raising?

2012-01-13 Thread Andrew Premdas
_______ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] getting ActionController::RoutingError when I test namespaced controllers

2012-02-02 Thread Andrew Premdas
> app root: > > rpsec spec > > (Sorry to any bothered readers for any undue brevity in the previous > post-response cycle, but I've assumed that the type of error > (RoutingError) in combination with the way rspec works and fails for > my functional tests was adequate to suggest a fix.) > > Thanks, > > Lille > ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > Just a wild guess here, but shouldn't the folder match the namespace, you have a beta folder and a Beta1 namespace -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Should I use cucumber or Controller RSpecs or both?

2012-02-14 Thread Andrew Premdas
very easy to implement in cucumber e.g - after all you just need to visit a url to generate the request. The only issue is that in Rails you may not get the error page you expect because you are running in test mode. You can address that by using an @allow-rescue tag on the feature. HT

Re: [rspec-users] requests: is it possible to put the fill_in's into a method?

2012-02-26 Thread Andrew Premdas
hould ... #{bad_attr}..." do fill_in(good_attrs(:except => {:bad_attr}) etc. All of top of my head so expect syntax errors, but hopefully enough to be useful All best Andrew HTH Andrew -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing selector order

2012-03-01 Thread Andrew Premdas
n to do it correctly. As a hack Capybara's all method in practice will return the paragraphs in order (but this isn't guaranteed by specification). HTH Andrew Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] can I output the html of the page after calling click_button?

2012-03-02 Thread Andrew Premdas
see below On 2 March 2012 03:33, S Ahmed wrote: > I am not sure why my form submission is failing (request test). > > I am calling: > > # form is filled in a 'before do' block. > > it "should create an account" do > expect { click_button "Create" }.to change(Account, :count).by(1) > put a deb

Re: [rspec-users] what RSpec approach could I use for this.

2012-03-05 Thread Andrew Premdas
T23:59:59+00:00 > * 2012-03-10T00:00:00+00:00, 2012-03-16T23:59:59+00:00 > * 2012-03-17T00:00:00+00:00, 2012-03-23T23:59:59+00:00 > > > thanks > > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-users mailing li

Re: [rspec-users] stuck in testing hell...

2012-05-01 Thread Andrew Premdas
e), ... Finally an important lesson is that your tests being green is really not that important. Its much more important that tests 1. say what they do 2. are listened to, so they exert a positive influence on your design 3. make things easy to fix when they go red All best Andrew ___ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] stub.as_null_object mock and double

2012-05-09 Thread Andrew Premdas
Hi there, Is there any particular reason why stub is not stub.as_null_object by default? Or alternatively is there some nicer sugar for stub.as_null_object Is RSpec trying to discourage the use of stub.as_null_object, and if so why? TIA Andrew -- Andrew Premdas

[rspec-users] error message for expect{}.should

2012-08-27 Thread Andrew Premdas
Hi all, Having not done any speccing for a few weeks I just spent ages puzzling over why the following code wasn't working it "should require a client" do expect{ }.should raise_error ArgumentError end and giving me a expected ArgumentError, got #__

Re: [rspec-users] RSpec newbie

2012-11-24 Thread Andrew Premdas
rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > -- Andrew Premdas blog.andrew.premdas.org ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Spec-ing private method

2013-05-16 Thread Andrew Premdas
On 16 May 2013, at 04:22, "Andrey S." wrote: > Yes, I know, that testing private methods it's not a good idea (and I > read this thread - http://www.ruby-forum.com/topic/197346 - and some > others) > > But how can I test the following code? > I use xmpp4r. In my public method #listen I start rece

Re: [rspec-users] how to write “Destroy kid” in cucumber

2013-09-30 Thread Andrew Premdas
d="kid_#{kid.id}"} =link_to 'Destroy' ... Your test is telling you your markup sux (thats why its so difficult to test). So instead of making the test do something really difficult, listen to your test and improve your code. > -- > Posted via http://www.ruby-foru

[rspec-users] Testing a wizard with Cucumber

2008-11-04 Thread Andrew Premdas
Assuming you have a multi-step wizard like thing, with lots of different states and paths through it. What approach would your use to write a feature for it? What I want to do is do the separate states and then reuse these things in more complex scenarios that cover paths. For example Scenario: Sta

Re: [rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
sy to represent or formulate. I can see that wanting this construct, could indicate a smell maybe a badly worded story - i.e. a conjunction step. All best Andrew 2008/11/4 Ashley Moran <[EMAIL PROTECTED]> > > On 4 Nov 2008, at 12:45, Andrew Premdas wrote: > > General case I&#

Re: [rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
smaller steps. However we only have 'And' available in stories, do we need 'Or'? All best Andrew 2008/11/4 Pat Maddox <[EMAIL PROTECTED]> > "Andrew Premdas" <[EMAIL PROTECTED]> writes: > > > General case I'm thinking about is just testing tha

Re: [rspec-users] Testing a wizard with Cucumber

2008-11-04 Thread Andrew Premdas
Thanks Matt, just what I was looking for :) Andrew 2008/11/4 Matt Wynne <[EMAIL PROTECTED]> > On 4 Nov 2008, at 15:41, Andrew Premdas wrote: > > Assuming you have a multi-step wizard like thing, with lots of different >> states and paths through it. What approach woul

Re: [rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
Oh I was definitely into theoretical speculation here :) - haven't got a particular case at the moment 2008/11/4 Zach Dennis <[EMAIL PROTECTED]> > On Tue, Nov 4, 2008 at 11:36 AM, Andrew Premdas <[EMAIL PROTECTED]> > wrote: > > Ok I see. I was approaching this

Re: [rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
e lots of times when having this sort of syntax would be useful. All best Andrew 2008/11/4 Ashley Moran <[EMAIL PROTECTED]> > > On 4 Nov 2008, at 11:26, Andrew Premdas wrote: > > Any ideas about the general case, is making a custom matcher the (only) >> way to go?

[rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
Is there any way to do foo.should (be_nil || be_empty) in rspec. Thanks in advance ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

2008-11-04 Thread Andrew Premdas
Sweet I'm using rails so will give it a go. Any ideas about the general case, is making a custom matcher the (only) way to go? All best Andrew 2008/11/4 Tom Stuart <[EMAIL PROTECTED]> > On 4 Nov 2008, at 11:10, Andrew Premdas wrote: > >> Is there any way to do >> f

Re: [rspec-users] Design Pattern proposal for better Rails development

2008-11-05 Thread Andrew Premdas
What you are suggesting here changing your api to make it easier to refactor your api. Your trying to do this by 1) Generalising the descriptivness of the api 2) Reducing the number of calls to your api Both of these are not particularly good ideas 1) Generalising your api, reduces it descriptiv

Re: [rspec-users] Design Pattern proposal for better Rails development

2008-11-05 Thread Andrew Premdas
l api that is clear and simple and consequently easier to refactor when the need arises 2008/11/5 David Chelimsky <[EMAIL PROTECTED]> > On Wed, Nov 5, 2008 at 9:12 AM, Andrew Premdas <[EMAIL PROTECTED]> wrote: > > What you are suggesting here changing your api to make it ea

[rspec-users] features and form filling - going declarative?

2008-11-06 Thread Andrew Premdas
I'm working on writing features for a wizard. The wizard collects information from a number of different forms, and you can navigate through it in a number of ways. Anyhow one of these forms is a customer form collecting name, and email. In the context of the wizard I feel that the following scena

Re: [rspec-users] features and form filling - going declarative?

2008-11-07 Thread Andrew Premdas
ow level (dare I say unit) features, which have the benefit of clearly documenting intention in a way that any other test mechanism I've seen so far cannot. The brain dump is much appreciated and helps Cheers Andrew 2008/11/7 Joseph Wilk <[EMAIL PROTECTED]> > Andrew Premdas wrote: >

Re: [rspec-users] features and form filling - going declarative?

2008-11-07 Thread Andrew Premdas
early. If something is in the right place is much easier to find out what it is trying to do. Maybe there is a need for a feature hierarchy in the same way there is a test heirarchy ... All best Andrew 2008/11/7 Matt Wynne <[EMAIL PROTECTED]>: > On 7 Nov 2008, at 06:09, Andrew Premdas wrot

Re: [rspec-users] [Cucumber] The User Story File

2008-11-07 Thread Andrew Premdas
You could try the bundle in the E editor on windows http://www.e-texteditor.com/ 2008/11/7 aidy lewis <[EMAIL PROTECTED]>: > Hi Matt, > > How are you? > > On 07/11/2008, Matt Wynne <[EMAIL PROTECTED]> wrote: >> Are you pairing with them? Can you not just drive and do the typing, asking >> them que

Re: [rspec-users] features and form filling - going declarative?

2008-11-07 Thread Andrew Premdas
+1 for abstract and concrete as it gives an indication of what the story should contain i.e. I should get an error vs I should be told my email must have an @ sign and be ... Andrew 2008/11/7 David Chelimsky <[EMAIL PROTECTED]>: > On Fri, Nov 7, 2008 at 9:58 AM, David Chelimsky <[EMAIL PROTE

Re: [rspec-users] Cucumber Scaffolds

2008-11-12 Thread Andrew Premdas
A couple of tips may help here. 1) You can debug features by putting 'debugger' in the step file. Just make sure there is a line after debugger e.g ... debugger response end If there's nothing after debugger you will stop in the cucumber code, which is not what you want. 2) You can also pu

Re: [rspec-users] Learning Cucumber

2008-11-13 Thread Andrew Premdas
What you're doing here is writing imperative features. Writing declarative features might be a better alternative. Instead of Given I am on the new entity page When I fill in a textbox labelled "Common Name" with "My New Entity" And I fill in a textbox labelled "Full Legal Name:" with "My N

Re: [rspec-users] Learning Cucumber

2008-11-14 Thread Andrew Premdas
James Byrne <[EMAIL PROTECTED]>: > Andrew Premdas wrote: >> What you're doing here is writing imperative features. Writing >> declarative features might be a better alternative. Instead of > ... >> >> Given I am on the new entity page >> When I c

Re: [rspec-users] specifying which button webrat should press

2008-11-20 Thread Andrew Premdas
I did something similar with Scenario: Cart shows item price and total price Given there is a product with name foo and price £24.50 And I am on the products page When I add product with name foo to cart And a step matcher When /^I add product with name (.*) to cart$/ do |name| p

Re: [rspec-users] Cucumber, Webrat and http basic auth

2008-11-20 Thread Andrew Premdas
Don't know if this is related, but webrat 0.3.4 introduced a bug with redirecting which I reported at http://webrat.lighthouseapp.com/projects/10503/tickets/67 Wonder if your problem happens with webrat 0.2? 2008/11/20 aslak hellesoy <[EMAIL PROTECTED]>: > On Thu, Nov 20, 2008 at 2:52 PM, kwe <

Re: [rspec-users] Cucumber: Group Given, Whens and Thens

2008-11-20 Thread Andrew Premdas
Also occasionally you may want to use a when as a given. Cucumber doesn't actually use the given|when|then|and to differentiate steps, just the regex that comes after them. Sometimes I feel that it makes sense as in the following examples When I log in as Fred Given I log in as F

Re: [rspec-users] Cucumber: Group Given, Whens and Thens

2008-11-21 Thread Andrew Premdas
DOH I thinks convention = I think this convention 2008/11/21 Andrew Premdas <[EMAIL PROTECTED]>: > Interesting ... so this establishes a convention to use in features > that all Givens are written in the past tense and all whens in the > present tense. > > I think its qu

Re: [rspec-users] Cucumber: Group Given, Whens and Thens

2008-11-22 Thread Andrew Premdas
ot alot of Givens to rewrite :) 2008/11/20 David Chelimsky <[EMAIL PROTECTED]>: > On Thu, Nov 20, 2008 at 10:40 AM, Andrew Premdas <[EMAIL PROTECTED]> wrote: >> Also occasionally you may want to use a when as a given. Cucumber >> doesn't actually use the given|whe

  1   2   3   >