Displaying 9 results from an estimated 9 matches for "should_eql".
Did you mean:
should_equal
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 should_not_be_activated
Is this using an old version of rspec, and/or do i need to define
these methods and how...
2006 Oct 17
0
new handling of equality
...hanges the way RSpec handles equality. Previous releases
tried to handle equality
based on the way the words read, rather than the way ruby actually
handles equality. So,
with this release and going forward:
* actual.should_equal(expected) will pass if actual.equal?(expected)
returns true
* actual.should_eql(expected) will pass if actual.eql?(expected) returns true
* actual.should == expected will pass if actual == expected) returns true
At the high level, eql? implies equivalence, while equal? implies
object identity. For more
information on how ruby deals w/ equality, you should do this:
ri equal?...
2006 Dec 04
5
should_be_different -- possible implementation
...class Object
def should_be_different(method = nil, difference = nil)
return self.should_not_eql(yield) if method.nil?
before = self.send(method)
yield
return self.send(method).should_not_eql(before) if
difference.nil?
(self.send(method) - before).should_eql difference
end
end
Usage:
specify "should be able to create a new user" do
Person.create(:name => ''joe'')
Person.should_be_different :count do
Person.create(:name => ''bob'')
end
end
This has...
2007 Apr 04
11
ANN: RSpec 0.9.0 beta-1 available for download.
We''d like to get some feedback on RSpec 0.9 before we start pushing
out releases via Rubyforge''s gem server and update the website. We
have therefore made the first beta of 0.9 available - both prepackaged
and tagged in subversion (see below).
RSpec 0.9 introduces a new API for expectations, which essentially
means that your underscores go away (there has been other discussions
2007 Jan 19
1
Error when following online tutorial
Hi
I''m following the tutorial from the website.
I''ve got to the end, but I''ve been getting this failure:
''A stack with one item should return top when you send it top FAILED
"one item" should equal "one item"
./stack_spec.rb:28:
./stack_spec.rb:27:in ''instance_eval''
3 specs 1 failure
I do not
2006 Dec 11
1
FAILED: "test" should equal "test" - what?
I''m trying out rspec_on_rails with a very simple test:
...
specify "product name should be ''test''" do
Product.find( :all ).first.name.should_equal ''test''
end
...
with this fixture:
first:
id: 1
name: test
When I run it:
.F
1)
''Given a generated product_spec.rb with fixtures loaded product name should
be
2007 May 26
11
RSpec
Hi RSpec Mailing list,
I''m new to RSpec and I am trying to get it running with the caboo.se sample
rails app.
I installed the current version of rspec with rspec_on_rails
I tried to run rake spec but received:
330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec
(in /Users/multimedia/Desktop/restful_auth_rspec)
2007 Jan 21
35
Collection proxies need to be stubbed ?
Hi all !
I just started writing specs on a new project. I would just like to
validate that this is the way you would write it. I know about mocks,
stubs and expectations. I don''t think this is a problem for me.
My question really boils down to:
def index
@projects = current_user.projects.active
end
My spec needs to return the proxy, no ? Here''s my code:
context "A
2007 Mar 24
15
State Based vs. Behaviour Based Spec/Testing
I''ve notice that a project like Rubinius has both a spec & a test
directory. Rspec has only a spec directory. Obviously I support
BDD, but isn''t there also a place for state based/verification
testing? I sometimes sense that I *do* want to practice Test Driven
Development. That is, I want some assurance that my production code
will run as intended. But I also