Displaying 20 results from an estimated 500 matches similar to: "artificial sugar causes cancer"
2006 Nov 19
2
underscores, sugar, and more and more bugs
I sent this earlier under with the subject "artificial sugar causes
cancer" and I think some spam filters ate it. Here it is again:
======================================
All,
If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
you''ll see that Chad (the submitter) found the source of the bug.
Unfortunately, the source
2006 Oct 16
2
subject.should_be true
As things stand now, the following will all pass:
true.should_be true
"true".should_be true
"false".should_be true
3.should_be true
etc
My feeling is that "should_be true" should only pass if it returns
boolean true even though ruby says that non-nil/non-false is true.
Anybody else?
David
2006 Sep 06
1
support for arbitrary comparisons
Mike Williams contributed a patch to support arbitrary comparisons.
This is now in the trunk and will be part of the next release. So you
will now be able to do this:
result.should_be < 5
result.should_be >= 7
It also supports alternate syntax for should_be, should_match
result.should == 3
result.should =~ /regex/
Personally, I prefer should_be and should_match in these cases, as I
think
2006 Oct 24
2
1 should be 2. huh?
There''s another quirk I wanted to bring up. It''s about the failure
message with should_equal and should_be.
x.should_equal 2
a.should_not_be nil
When they fail they yield messages like:
1 should equal 2
nil should not be nil
When I''m caught off guard, which can be often, these messages confuse
me. 1 should equal 2? No it shouldn''t. nil should not be
2006 Oct 17
0
new handling of equality
All,
Based mostly on the earlier thread on "should_be", we have introduced
a new branch called should_be_working_like_ruby with the new proposed
handling for equality.
Per the CHANGES file in that branch (rev 896):
============================================
IMPORTANT NOTE: THIS RELEASE IS NOT 100% BACKWARDS COMPATIBLE TO 0.6.x
This release changes the way RSpec handles equality.
2006 Dec 13
3
Testing has_many :through
I''m working with a has_many :through association, where a Member
has_many Projects through ProjectViewers. The problem I''m running
into is that Rails doesn''t load the association so line (3) fails
until I explicitly access a member of the collection (in this case, I
iterated it). Is there a better way?
Thanks,
Steve
1. assigns[:member].should_not_be_nil
2.
2008 Aug 20
9
I want RSpec for CSS layout.
I don''t even know how it''d be possible (through Selenium?), but I want it.
I want to see if my stupid CSS hacks break. I want to say:
describe "#nav-column" do
body = something("#body-column")
it "should line up at the top" do
dom[:top].should_be == body.dom[:top]
end
it "should always be to the right" do
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running
the following:
should_render(:index)
should_be_valid
should_not_be_valid
should_respond_to
should_be
should_render
I thought the syntax changed to something like the following:
obj.should render(:index)
but this doesn''t seem to work.
Scott
2006 Dec 31
2
what''s with the response.should_be_xxxx stacktrace?
If I do
get :index
response.should_be_success
I get about 20k of marshalled dumpage that starts like
#<ActionController::TestResponse:0x390443c @body=\"<html><body>You
are being <a href=\"http://test.host/carts/1\">redirected</a>.</body></html>\",
@assigns=[], @redirected_to={:action=>\"show\", :id=>1},
2007 May 09
4
UI testing framework? (w/o selenium)
Hey all,
I am currently working on coming up w/ an easy to use, developer-centric web
testing framework to test a J2EE app with. (I have 3 rails apps in
production, love rspec, and am currently at a java shop).
I''ve looked at selenium, and it just doesn''t seem like it is ready for prime
time, and the target audience is developers. So, having said that, does
the rspec
2007 May 30
2
should_eql etc?
Hi, I''m trying the specs for restful_authentication I found here
http://jonathan.tron.name/articles/2007/01/02/rspec-on-rails-restful-
authentication
It seems to use custom .should methods: should_eql,
should_be_an_instance_of, should_redirect_to, should_be_success,
should_not_be_nil, should_be_nil, should_not_be_nil, should_be_empty,
should_be_success, should_not_change, and
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here:
http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks
Most notably: a single expectation per specify block; the setup block
contains only stubs; mock expectations each get their own specify
block. (I''m still using 0.8, so I haven''t gotten the describe/it
goodness yet.)
I
2006 Aug 31
2
RSpec style in Scriptaculous'' unittest.js
Doing Javascript?
Looks like Scriptaculous'' *excellent* unittest.js has got some BDD love:
http://ajaxian.com/archives/scriptaculous-behaviour-driven-development-testing
Aslak
2006 Oct 17
0
actual.should != not_expected
All,
In dealing with the changes to should in the
should_be_working_like_ruby branch, I am reminded that while we got
the following to work ...
actual.should_be < value
actual.should_be <= value
actual.should == value
actual.should =~ value
actual.should_be >= value
actual.should_be > value
... we were not able to get this to work:
actual.should != value
Here''s what the
2006 Sep 07
0
Dead easy Watir AND Selenium
Yesterday I added some Watir examples to RSpec''s svn.
Today I added some Selenium (actually - Selenium Remote Control) examples.
It''s dead easy to use both, and the Ruby code you end up writing is
actually quite similar. Here''s a taste:
== Watir ==
require File.dirname(__FILE__) + ''/rspec_watir''
context "Google''s search page" do
2007 Mar 14
5
What''s the new syntax for predicates?
@settings.should allow_publish_ip("127.0.0.1") fails with
undefined method `allow_publish_ip'' for #<#<Class:0x2f8fd48>:0x2f5a968>
@settings.should_allow_publish_ip("127.0.0.1") works fine
This is rspec 0.8.2.
http://rspec.rubyforge.org/documentation/expectations.html says that
matching arbitrary predicates is deprecated and to see
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently.
I have a section of code like this:
ActiveRecord::Base.transaction do
cow.save!
duck.save!
dog.save!
end
(Names changed to protect the innocent.)
I''d like to specify that the saves run in a transaction. I can do
ActiveRecord::Base.should_receive(:transaction).and_yield
But is there any way to specify that the code is
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2007 Feb 04
10
Spec''ing ActionMailer
Good morning (Pacific Time). I have a controller action that, as a
side-effect, sends an email to an administrator. I want it to do
something like this:
specify "when someone successfully signs up, an email should be sent
to the administrator with the person''s contact page" do
post :signup, {...lots o'' params}
response should_be success
#
2006 Nov 21
6
Spec Naming (was: Rspec Brown Bag)
Thanks for posting your specdoc, Brandon -- they''re a great example.
On 11/21/06, Brandon Keepers <bkeepers at gmail.com> wrote:
>
> A user purchasing items
> - should create an order
> - should add to the user''s orders
> - should create line items
> - should set line item amount to the item''s price
> - should set line item amount to 0 if