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
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|
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
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
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
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
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 %>
>
> <%=
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.
> 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
> 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
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
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
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
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
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
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
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-
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"
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
.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
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
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
.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
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
__
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
> 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
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
. 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
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.
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
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
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
> 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)
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
> 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
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
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
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
> 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
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
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
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
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
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?
>__
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
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
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
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
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
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
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
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
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
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
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
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
> 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.
>
>
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
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
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
hem want to work on that video.
Alex
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
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
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
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
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
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
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
67 matches
Mail list logo