Re: [rspec-users] how to check with rspec if controller action set needed instance variables ?

2012-12-13 Thread Alex
Thanks Andy for your help On Thursday, December 13, 2012 5:05:45 PM UTC+2, Andy Lindeman wrote: > > On Thu, Dec 13, 2012 at 7:06 AM, Alex Leasenco > > > wrote: > > def view_task > > @task = params[:task] > > @back_to = view_path(@camp) > > end &g

[rspec-users] How to test the code inside the block of the to_xml function?

2009-02-10 Thread Alex
Hi all, when I spec the to_xml function like this: @some_model.should_receive(:to_xml), it dskips the code located in the block, here is the controller code: ... output = @detenteur.to_xml( :skip_types => false, :skip_instruct => true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|

[rspec-users] How to spec a around_filter

2009-03-25 Thread Alex
Hi all, any of you guys had success specking out a around_filter? I tried a few things like controller.should_receive (:around_filter_method), controller.stub!(:around_filter_method) but without success. In fact, the method is always executed even though I stubed it. What I find strange is that I a

Re: [rspec-users] How to spec a around_filter

2009-03-26 Thread Alex
Works like a charm! Thanks a lot. On Mar 25, 9:59 pm, Chris Flipse wrote: > I havn't done this myself, but would > controller.stub!(:around_filter_method).and_yield  work? > > On Wed, Mar 25, 2009 at 4:15 PM, Alex wrote: > > Hi all, any of you guys had success specking

Re: [rspec-users] How to spec a around_filter

2009-03-26 Thread Alex
Works like a charm! Thanks a lot. On Mar 25, 9:59 pm, Chris Flipse wrote: > I havn't done this myself, but would > controller.stub!(:around_filter_method).and_yield  work? > > On Wed, Mar 25, 2009 at 4:15 PM, Alex wrote: > > Hi all, any of you guys had success specking

[rspec-users] Problems withe the template...

2009-04-22 Thread Alex
Hello everybody ! I have in a view something like this : <% unless (method_name?(id)) then %> <%= link_to h(t(:BTN)), new_url_path(id) %> <% else %> <%= link_to_function h(t(:BTN)), 'return false;' %> <% end %> all of this works

Re: [rspec-users] Problems withe the template...

2009-04-22 Thread Alex
Problem solved! Sorry about that, turns out it wasn't an error Thanks! On 22 avr, 12:27, Alex wrote: > Hello everybody ! > > I have in a view something like this : > > <% unless (method_name?(id)) then %> >         >             <%=

Re: [rspec-users] running a fast subset of the specs

2009-08-26 Thread Alex Chaffee
Sure. Put all your fast specs in a subdirectory spec/fast. Then Spec::Rake::SpecTask.new do |t| t.spec_files = FileList['spec/fast/**/*_spec.rb'] end or something to that effect. Alternately, put your slow specs in a subdirectory, but I think the above way is arguably cleaner.

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Alex Chaffee
> I often create integration programs in Ruby that utilize ActiveRecord without > the full Rails stack. So I wonder what the best way would be to fully utilize > Cucumber and RSpec for BDD in this context. > > 1. Should I still include rspec-rails so hopefully at least the Model support > is ava

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Alex Chaffee
> Wow you seem to have already been down this path and this is excellent > advice - thanks!!! :-) http://github.com/alexch/vegas ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] OT: Identifying unused code?

2010-02-10 Thread Alex Satrapa
d to the feature I wished to remove. So I'm left with 100% code coverage, due to a few specs hanging around which cover functions that are no longer actually required. Have you run across this situation? What do you do to prevent the "zombie" code hanging

[rspec-users] ApplicationController helper methods in view specs?

2010-06-28 Thread Alex Crichton
I've got some helper methods in my ApplicationController which the views use. In the view specs the methods are all undefined, however. Is this intended and is there some setting I need to use to get the methods included? ___ rspec-users mailing list rspe

[rspec-users] Windowed comparison for differences in the middle of long strings

2010-07-14 Thread Alex Chaffee
When two strings fail to match, if the difference is somewhere in the middle of the strings, it can be annoying/impossible to track down the actual difference. I've written a little Comparison object that provides this kind of error message: Strings differ at position 12: expected: ..."efghijklmno

Re: [rspec-users] Missing template in helper specs with a render

2010-08-24 Thread Alex Pressberg
Yes! We do use render in helpers to a great extent and are bitten by the "missing template in view path" error too. Any workarounds? Can the view path be easily fixed for helper specs in Rspec 1.3? Does Rspec 2 already support this? Cheers, Alex David Chelimsky wrote: > On Thu, J

Re: [rspec-users] cucumber generator error in rails 3

2011-02-09 Thread Alex H.
I also get this error, after I run "rails generate cucumber:install # Rails 3". My target is that let Cucumber-Rails add a few files to your project. I am following the guid of https://github.com/aslakhellesoy/cucumber/wiki/Ruby-on-Rails I run bundle install. Out put as following: Using rake (0

[rspec-users] Collection membership Error

2011-07-02 Thread Alex Katebi
Using rspec version 2.6.4 I get an error with the Collection membership. Example: [1,2].should include(1) TypeError: wrong argument type Fixnum (expected Module) from (irb):1:in `include' from (irb):1 from /home/akatebi/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `' RubyG

[rspec-users] improving TextMate RSpec Bundle's error output

2011-08-12 Thread Alex Chaffee
re-pretty test results as they happen Non-TextMate users need not reply :-) - A -- Alex Chaffee - a...@stinky.com - http://alexch.github.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com ___ rspec-

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

2011-08-29 Thread Alex Chaffee
example, but I think the above example would become rescuing { run_command(%w[ missing_wallet.dat ]) }.message.should == "Couldn't find whatever" We've also got "capturing" for grabbing console output, e.g. capturing { puts "hi" }.should == "hi"

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

2011-08-30 Thread Alex Chaffee
apologies if you already know this, but inside a normal Ruby program you should always use $stderr/$stdout/$stdin, not STDERR/STDOUT/STDIN since the former are settable and the latter are hardcoded to the "real" streams and, as true CONSTANTS, not easy to change. For whatever reason I s

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-13 Thread Alex Chaffee
.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/listinf

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

2011-09-15 Thread Alex Chaffee
https://github.com/defunkt/fakefs might help too -- Alex Chaffee - a...@stinky.com http://alexch.github.com http://twitter.com/alexch ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-20 Thread Alex Chaffee
f of four" do eventually { (two + two).should == 4 } end end should work soonish... -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-21 Thread Alex Chaffee
.S. (Lurkers please feel free to chime in too. :-) [1] https://github.com/pivotal/selenium/blob/master/lib/selenium/wait_for.rb [2] https://gist.github.com/1228927 -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-21 Thread Alex Chaffee
t idiomatic RSpec, but perhaps it is idiomatic > Wrong, since you can do all that magic to infer an error message anyway, > right? I hope so... I mean, uh, yes! Definitely! :-) -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch __

Re: [rspec-users] Assertions for asynchronous behaviour

2011-09-27 Thread Alex Chaffee
contains a "should" or a Wrong "assert" then it ends up looking like it just got called and failed the final time. It'd be nice if I could sneak into an exception and append "(after 5 sec)" to e.message but I don't know if I want to go there... -- Alex Cha

Re: [rspec-users] Custom Formatter: Getting Text from It Method

2011-09-30 Thread Alex Chaffee
> The reason I'm doing this is because I'd like viewers of the test results to see the exact condition that was tested for in the should if they want to -- without having to read the code. Have you seen Wrong? You just described its intent :-) http://github.com/sconover/wrong If you get a source

Re: [rspec-users] Override tests (of a core rails app from a plugin)

2011-10-02 Thread Alex Chaffee
s.) you could say "if the core tests without the plugin and the plugin tests > with the plugin work, everything is fine", it doesn't work that well though. If your app is using a plugin, then why (and how) would you ever test your app without the plugin? -- A

Re: [rspec-users] Assertions for asynchronous behaviour

2011-10-13 Thread Alex Chaffee
. Useful for debugging (which is what "d" stands for) when you don't want the test flow to stop with an assert or should. - A -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch On Sun, Oct 2, 2011 at 2:02 PM, Matt Wynne wrote: > > On 28 Sep 2011

Re: [rspec-users] Weird behavior with should_not_receive

2011-11-06 Thread Alex Chaffee
Double negatives are not unconfusing. Not unlike chaining mutable decorator objects. (I was tempted to say "non-immutable" but that would chain the jokes) btw with .once and .twice, why not .thrice? Lady or no. -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.

Re: [rspec-users] Weird behavior with should_not_receive

2011-11-07 Thread Alex Chaffee
On Sun, Nov 6, 2011 at 2:55 PM, David Chelimsky wrote: > There you go :) > You are three times a gentleman, David. -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch ___ rspec-users mailing list rspec

[rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
I don't know where to put this post, but theme of this more similar to my issue. I have trite signin system, like this: > ApplicationController: include SessionsHelper private helper_method :current_user def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
Aslak, but if I haven't Google Account? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
> that is added to cucumber's world does not have access to your > application > controller's @current_user variable. So, I understand this. But how I can avoid this defect? If I paste def is_admin? into application_controller near current_user method, I wouldn't can World(ApplicationController)

Re: [rspec-users] cucumber is_admin? testing

2011-11-24 Thread Alex Whiteland
Aslak, I send a message to group email, but I haven't answer yet. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-11-24 Thread Alex Whiteland
> What email did you send to? cu...@googlegroups.com > I'm assuming you're using a regular mail client? I work from browser. I sent to you from awhiteland.37.com (first . replace to @) -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing

Re: [rspec-users] cucumber is_admin? testing

2011-11-27 Thread Alex Whiteland
bump! I sent letter 3 day ago. No email answer, no new theme in group, no new message here. But new message in group exists. Why? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/ma

Re: [rspec-users] cucumber is_admin? testing

2011-11-28 Thread Alex Whiteland
I sent copy of my issue to cu...@googlegroups.com from awhitel...@hushmail.com -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-11-28 Thread Alex Whiteland
code to sessions_helper, then session[:user_id] wouldn't work. Regards, Alex Whiteland > end -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-11-28 Thread Alex Whiteland
> 1. actually log in (i.e. create a user, go to the login screen and log > in). You can wrap this in a single step definition like "Given I am > logged in as 'admin'", but you still have to go through the app within > the step definition. I do this. Here is example: Scenario: guest becomes a user

Re: [rspec-users] cucumber is_admin? testing

2011-12-02 Thread Alex Whiteland
Hi, Andrew. I resent msg now. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-12-07 Thread Alex Whiteland
hmm... I changed 2 servers to friend with google. wtf? first - 37.com, second - hushmail.com Maybe, google think it is spam and sends to it folder. Can yo find my letters in it? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list

Re: [rspec-users] bug: rspec rails generator generates a failing spec

2012-03-22 Thread Alex Chaffee
Oops. This is apparently not an rspec bug after all... the tutorial instructions generated the StaticPages controller in a non-standard way. Sorry for the false alarm! On Thursday, March 22, 2012 2:19:04 PM UTC-7, Alex Chaffee wrote: > > Using rspec 2.9.0, rspec-rails 2.9.0, rails

[rspec-users] bug: rspec rails generator generates a failing spec

2012-03-22 Thread Alex Chaffee
Using rspec 2.9.0, rspec-rails 2.9.0, rails 3.2.2, following Michael Hartl's RailsTutorial, version 3.2, chapter 3. Running rails generate integration_test static_pages makes a spec named static_pages_spec.rb that contains the following code get static_pages_index_path which causes this erro

Re: [rspec-users] Database custom formatter

2012-04-06 Thread Alex Chaffee
I'm about to start work on a JSON formatter. (I need it for a project where I'm executing RSpec on a server and shipping it down to a JS/HTML client for http://testfirst.org .) Any advice other than "look at lib/rspec/core/formatters/*.rb" before I start? >__

Re: [rspec-users] Simple code dosn't work

2012-04-11 Thread Alex Chaffee
should be j.should be_even (though following Skitt's Law, I probably got that wrong) - A P.S. In Wrong, it's assert { j.even? } -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch ___ rspec-users maili

[rspec-users] how to check with rspec if controller action set needed instance variables ?

2012-12-13 Thread Alex Leasenco
def view_task @task = params[:task] @back_to = view_path(@camp) end Thanks Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Test-Driving Screencast

2013-07-02 Thread Alex Chaffee
ng demo of using RSpec to test-drive a simple class. Hopefully this will be useful to people learning RSpec and BDD. Feedback always welcome! - Alex -- Alex Chaffee - a...@stinky.com http://alexchaffee.com http://twitter.com/alexch ___ rspec-users ma

[rspec-users] Render_template return true when only part of template name match. Bug?

2008-10-29 Thread Alex Rudyk
I have this code response.should render_template(:my_messages) It returns true also if :messages template rendered. I am confused, is this a bug or expected behavior? Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org

Re: [rspec-users] Caboosers drop RSpec

2008-11-05 Thread Alex Satrapa
I can't understand why people who are serious about production environment stability would install multiple applications in the same environment. It's not healthy. Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Constraints / Global requirements

2009-01-13 Thread Alex Satrapa
On 14/01/2009, at 09:17 , Zach Dennis wrote: The only recommendation I have is for people to not remove the portion of the email they are responding to, and to keep their response close in approximation to what they are responding to. A: Because it messes up the order in which people normally

Re: [rspec-users] Childrens book

2009-01-14 Thread Alex Satrapa
On 15/01/2009, at 10:31 , aslak hellesoy wrote: So I'm starring in a childrens' book with a cuke. Watch out! That cucumber is a Perl evangelist! ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-use

Re: [rspec-users] validate_presence_of

2009-02-18 Thread Alex Satrapa
t, and get on with the next terribly pressing task. Alex PGP.sig Description: This is a digitally signed message part ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] validate_presence_of

2009-02-18 Thread Alex Satrapa
testing, then testing driven development, and then behaviour driven development. I prefer my feet intact and still attached to my legs! Alex PGP.sig Description: This is a digitally signed message part ___ rspec-users mailing list rspec-users@ruby

Re: [rspec-users] validate_presence_of

2009-02-18 Thread Alex Satrapa
ne at a time. My fault entirely, the guy is now "doing it right" :) Alex PGP.sig Description: This is a digitally signed message part ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Problem Comparing Floats

2009-08-24 Thread Alex Chaffee
figure that out when your ultra-precise spec starts failing. >> Temperature.new.ctof(37) => 98.6 >> Temperature.new.ctof(37) == 98.6 => false >> "%.30f" % Temperature.new.ctof(37) => "98.608526512829121202" Thoughts? --- Alex C

Re: [rspec-users] Problem Comparing Floats

2009-08-24 Thread Alex Chaffee
you are unfamiliar with the vagaries of floating point math -- or even if you momentarily forget -- then using == will occasionally mysteriously fail. So my proposal remains: can the == matcher do be_close(x, 0.01) for floats? Arguments pro and con? --- Alex Chaffee - a...@stinky.co

Re: [rspec-users] Problem Comparing Floats

2009-08-24 Thread Alex Chaffee
> What about a helpful error message when "should ==" fails on floats: > > expected 98.6, got 98.6 > > The expected and actual may appear to be the same due to Ruby's string > representation of floating point numbers. For floating point math, we > recommend using the be_close() matcher instead. > >

Re: [rspec-users] mocks & stubs

2009-08-25 Thread Alex Chaffee
e are lots of people who use mocks all the time, so I'll let them make the arguments in favor... Stubs and Fakes, however, can be more robust. Don't paint all Test Doubles with the same brush! :-) --- Alex Chaffee - a...@stinky.com - http://alexch.github.com Stalk me: http://friendfe

Re: [rspec-users] "should_not ==" vs "should !="

2008-01-20 Thread Alex Satrapa
g tree and potentially misleading dozens of programmers down the garden path? Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Spam Protection

2008-01-20 Thread Alex Satrapa
me time that Skynet takes over and flying pigs start snowball fights with the legions of hell. Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Generated rspec video

2008-02-11 Thread Alex Satrapa
hem want to work on that video. Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] How to dump contents produced during spec evaluation?

2008-02-24 Thread Alex Satrapa
quot;, and later versions have to be renamed eg: "when the user creates a new resource with special feature X". That's not happening here as far as I can tell. Any clues on where to start looking? Thanks Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to dump contents produced during spec evaluation?

2008-02-24 Thread Alex Satrapa
On 25/02/2008, at 10:58 , David Chelimsky wrote: > On Sun, Feb 24, 2008 at 5:54 PM, Alex Satrapa > <[EMAIL PROTECTED]> wrote: >> In the ResourceController spec, I have the following happening: >> post( :create, :resource => request_attrs ) >> response

Re: [rspec-users] How to dump contents produced during spec evaluation?

2008-02-24 Thread Alex Satrapa
On 25/02/2008, at 11:42 , David Chelimsky wrote: > Steve - it's because of isolation - I pointed Alex to the docs. Yup, I'm having a low-caffeine day apparently. I'm going to great pains to isolate just the portions of the controller that need to be designed (using mock

Re: [rspec-users] newb q: Can story steps report a view rendering error?

2008-04-02 Thread Alex Satrapa
d it for a refresher every now and then. Hope this helps! Alex ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Is BDD with RSpec cheaper?

2008-07-07 Thread Alex Satrapa
where I work that insists on big design up front. They fully specify the software using UML or whatever the flavour of the month is, then implement from that. Just one more reason why I don't ever want to work within a bureaucracy. Alex ___ rspe

Re: [rspec-users] Someone please name this matcher for me

2008-08-06 Thread Alex Satrapa
On 07/08/2008, at 05:04 , Jonathan Linowes wrote: .should be_bag_of( [1, 3, 1, 4, 2] ) FWIW, I am in favour of this naming. Now back to lurking :) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-user