gt;> end
>>
>> it "should do another thing" do
>> @variable.should do_another_thing
>> end
>> end
>>
>> def some_expensive_operation
>> p "in here"
>> end
>> end
>>
>> (also uploaded to http
To answer myself, I've put together the following work-around:
http://www.swombat.com/getting-rspec-beforeall-and-nested-contexts-w
Still, would love to know if there was a better, less hackish way to do it.
Daniel
On Thu, Jul 9, 2009 at 11:40 AM, Daniel Tenner wrote:
> Hi all,
> Li
'm quite happy to give up the ability to have before
blocks in the sub-contexts in order to ensure that the expensive operation
is only run once...
Your thoughts most welcome... (including, perhaps, telling me that I'm Doing
It Wrong)
Daniel Tenner
http://www.woobius.com
http://danielten
At the risk of sounding a bit silly, what's your question? I couldn't
find a question mark in the whole email...?
Daniel
On 17 Jan 2008, at 07:20 17 Jan 2008, Giles Bowkett wrote:
> This is something I've come up against twice. First, I have an
> interactive editor which calls vi, emacs, or Te
Just to clarify, this is what I meant in my original email :-) Most
of my methods are very small - in Ruby any method longer than 5 lines
is, imho, a code smell that's waiting to be fixed. However, no matter
how many methods are used to implement the functionality, I test the
public behavio
Might be a personal thing, but my approach is that I try to test the
public behaviour of the object. Testing private methods is, imho,
getting dangerously close to specifying how the object does its
business, rather than what it does.
I would just spec the externally visible behaviour, where
x27;s much more likely to break is SantasMailbox - so focus the
time, the effort, and the lines of code on speccing that quite
thoroughly, so you know it can take every likely Message that you
might throw at it.
(/opinion)
Daniel
On 13 Dec 2007, at 14:44 13 Dec 2007, Rick DeNatale wrot
>> Sorry, perhaps I gave too simplistic an example.
>>
Real code, please? :-)
Simplified examples only ever result in simplistic suggestions.
Daniel
On 13 Dec 2007, at 07:55 13 Dec 2007, Jonathan Linowes wrote:
>
> On Dec 13, 2007, at 2:47 AM, Jonathan Linowes wrote:
>
>>
>> On Dec 13, 2007, at
ent => people(:john)
}
SantasMailbox.should_receive(:deliver_secret_santa).with(Message.new
(msg_creation_parms))
Which would imply you're building the subject, body, sender and
recipient before passing things on to the mailer? Maybe I got this
all wrong though...
Daniel
On 13 Dec 2
Hi Rick,
I'm probably a heretic on this point, but I would test
that :deliver_xyz is being called but not specify what parameters
it's called with.
What's my reasoning?
- What I'm really testing in the Message spec is not the validity of
the email that's being sent, but the fact that an em
oads using controller specs, which works but is
not as
clear as a Story.
I'm guessing the bug where it changes the TempFile to a String will
be fixed
soon by the core team, but if someone has a patch it would be awesome!
Rai
Daniel Tenner wrote:
I've now located where this is goin
%5Bid%5D=1330&request_type=xml"
Obviously that's not going to work. I wonder how Test::Unit does it,
then, though...
Daniel
On 11 Dec 2007, at 14:54 11 Dec 2007, Daniel Tenner wrote:
Hi Luis,
I read through that thread, but unfortunately it wasn't much help.
fixtu
ould be welcome!
Thanks,
Daniel
On 11 Dec 2007, at 14:39 11 Dec 2007, Luis Lavena wrote:
On Dec 11, 2007 10:57 AM, Daniel Tenner <[EMAIL PROTECTED]>
wrote:
I've pasted up the code at:
http://pastie.caboo.se/126925
Since there are quite a few files involved.
Thanks for your
I've pasted up the code at:
http://pastie.caboo.se/126925
Since there are quite a few files involved.
Thanks for your time,
Daniel
On 11 Dec 2007, at 13:28 11 Dec 2007, David Chelimsky wrote:
On Dec 11, 2007 6:18 AM, Daniel Tenner <[EMAIL PROTECTED]> wrote:
Hi all,
I'm
Hi all,
I'm trying to run a Story Runner integration test that uploads a file
through Attachment-fu.
I've tried various ways of specifying the file data, from custom mocks:
class MockFile < Struct.new
(:original_filename, :read, :content_type); end
fdata = MockFile.new "test_upload.txt", "Tes
Try:
get :download, :ids => ids_string
You need the ":" in front of the action name.
Daniel
On 4 Dec 2007, at 09:28 4 Dec 2007, Al Chou wrote:
I actually did stub Order.find() but was getting a nil object error
because params[:ids] was nil. I can't write
controller.download :ids => '1/2/3
The code works fine. I was asking about the "given" thing.
Daniel
On 3 Dec 2007, at 13:32 3 Dec 2007, Bryan Liles wrote:
>
> On Nov 29, 2007, at 5:54 AM, Daniel Tenner wrote:
>
>> What are people's opinions on which of these two styles is better to
>> use?
Hi Daniel,
You're trying to do too much in the controller. It's not the
controller's responsibility to ensure that the user is capable of
returning its own article without including anyone else's - that's
the user's (or the Article model's, perhaps) responsibility. Your
controller should
What are people's opinions on which of these two styles is better to
use?
1) before
---
module UserSpecHelper
include GenericSpecHelper
def valid_sms_attributes(phone_number="12345")
{ :phone_number => phone_number }
end
end
describe User, "with phone numb
block)
Makes all the specs pass.
Obviously not a desirable permanent change... but at least until
RubyAMF gets fixed.
Thanks for the help all!
Daniel
On 28 Nov 2007, at 16:39 28 Nov 2007, Daniel Tenner wrote:
> Ok, I've ditched externals and switched to piston... wiped out all
> the
Ok, I've ditched externals and switched to piston... wiped out all
the plugins and reinstalled them...
And still I'm getting that error.
No one else is getting this?
Daniel
On 28 Nov 2007, at 14:49 28 Nov 2007, David Chelimsky wrote:
> On Nov 28, 2007 8:44 AM, Daniel T
ov 2007, at 14:36 28 Nov 2007, David Chelimsky wrote:
> On Nov 28, 2007 8:29 AM, Daniel Tenner <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> Not sure if I'm the only one with this problem...
>>
>> We're on edge for both rails and rspec, and i just did an up
Hi all,
Not sure if I'm the only one with this problem...
We're on edge for both rails and rspec, and i just did an update...
Some apparently innocuous rails stuff was updated, and then half my
specs broke due to an error in rspec_on_rails:
ArgumentError in 'UserController without logged in u
finitely not afraid of mocking now :-)
Thanks for the discussion last month!
Daniel
#swombat
On 20 Oct 2007, at 23:49 20 Oct 2007, Daniel Tenner wrote:
> On 20 Oct 2007, at 19:54 20 Oct 2007, Pat Maddox wrote:
>> You seem to believe that the only way to define behavior is in terms
>&
.
Hope this helps someone :-)
Daniel
On 26 Nov 2007, at 19:09 26 Nov 2007, Daniel Tenner wrote:
> First time I have a look inside the RSpec codebase (let alone the
> Story Runner), and not much luck this time. But, counter-intuitively
> enough, I think it's probably nothing to do w
sh Knowles <[EMAIL PROTECTED]> wrote:
>> On 11/26/07, Daniel Tenner <[EMAIL PROTECTED]> wrote:
>>> Just seven upped the latest rspec update, and suddenly all my
>>> be_matchers don't work anymore (they worked just before I updated):
>>
>>
>
Just seven upped the latest rspec update, and suddenly all my
be_matchers don't work anymore (they worked just before I updated):
User.find_by_email(email).should_not be_confirmed
User.find_by_email(email).confirmation_code.should_not be_nil
>>
FAILURES:
1) confirmation (
Ok, maybe I'm being particularly thick, but I've been trying to find
the solution to this for a couple of hours now and I just can't seem
to be able to do it...
I'm trying to write a step as such:
Given("user $email is logged in") do |email|
user = User.find_by_email(email)
sessi
On 20 Oct 2007, at 19:54 20 Oct 2007, Pat Maddox wrote:
> You seem to believe that the only way to define behavior is in terms
> of interactions with other objects. That is flat-out wrong. Please
> read http://martinfowler.com/articles/mocksArentStubs.html.
Thanks for that excellent link. I hadn
On 20 Oct 2007, at 17:34 20 Oct 2007, David Chelimsky wrote:
> Agreed. This is exactly why we talk about stories and specs instead of
> integration and units. I realize that I've slung the term integration
> tests around when talking about about stories so I apologize if I've
> added to the confus
I would like it :-)
On 19 Oct 2007, at 19:45 19 Oct 2007, Russell Norris wrote:
> I recently wrote a matcher for testing AR associations which allows
> you to specify things like:
>
> Foo.should have_many(:bars).through(:bazes)
>
> I'm pretty darned proud of it and a couple of people have sug
nge so they are
> less brittle. Internal structure tends to change more than an object's
> API. Make sense?
>
> So with that, I really don't think there is a need for a new grouping
> of tests. That's my opinion. I look forward to everyone else's.
>
>
Hi all,
I've been thinking about the whole validator/relationship speccing
issue, and I came up with a suggestion, which I'd love to get some
feedback on.
The full article is available at http://www.inter-sections.net/
2007/10/19/what-to-test-and-specify-and-where-to-do-it/ , with the
rele
33 matches
Mail list logo