with
ordinary `mock`. I can replace it with `mock_model`, but this feels unclean.
Has anyone come across a good 'best-practice' solution to this problem?
TIA,
Paul Sadauskas
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
e I wanted:
@comment = mock_model(Comment)
@article = mock_model(Article, :comments => (@comment = assoc_mock(:find
=> [EMAIL PROTECTED])))
But this works just like the stub!(Foo, :method => return). I might keep
mine, though, its a little more explicit as to what the 'in-between'
tiple failures i.e. a spec containing 4 examples
produced the following output
3 examples, 3 failures
...
6 examples, 6 failures
Both of these issues disappeared when I reverted to 1.2.8. I'll add
more to this thread if and when I re-upgrade.
Paul
___
r
> Hi Paul
>
> I use Merb extensively. Can you post your spec_helper? I may be able to
> help...
>
> Ashley
Hi Ashley
Many thanks for your offer.
If I create a new merb app (1.0.12) and model and then run rake spec,
all is well. However, if I copy its spec_helper into my own
tringIO#readline, but it should do the trick.
(2) I would encourage you to consider this: rather than asserting that every
line is _read_, simply verify that the result of your Subject#parse
method
includes data that would _prove_ that each line has been read. That way
I "color" escape sequences are output in
> "raw" form. Unlike -r, the screen appearance is maintained correctly
> in most cases.
You can set default options for less to use via the LESS evironment variable.
As an example, here is the value of mine:
$
NSIColor.coloring = false if !STDOUT.tty? and not
> ENV.has_key?("AUTOTEST")
So, we can either feature request an override variable for this line, or
perhaps there is a way to trick a program that STDOUT is actually a tty...?
Paul
__
l :qux"
(...fix :foo...)
"Expected :bar to equal :qux"
(...fix :bar...)
"Expected :baz to equal :qux"
(...realize the _real_ problem is in dependent code that
affects all of foo bar and baz, and fix that...)
PASS
each
if someone could help me understand I'll happily open up my
expectation to should_raise(NameError) and move along. :)
Cheers,
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
.create_fixtures('test/fixtures', 'roles')
Fixtures.create_fixtures('test/fixtures', 'role_members')
Fixtures.create_fixtures('test/fixtures', 'rights')
Hope this helps!
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
odd, and I'm not sure without more context why this would be
happening. My guess is that something else wasn't wired up correctly
when you tried to do this.
> Hope this clarified, it's not real production code, but it models a
> behavior sometimes I actually needed
specific argument expectation (along the lines of my suggestion) that
executes in a context in which it can call the block.
Am I missing something obvious here, or does rspec currently not allow
for this easily? If not, let's discuss how it should look and I can
work on adding feature.
Che
Ashley Moran on 2010-01-28 at 13:28:
>
> On Jan 28, 2010, at 1:29 pm, Paul Hinze wrote:
>
> > I believe the lack of ability to use this notation comes down to a ruby
> > limitation, but I'm not sure. If that's the case, then we would need a
> > specific arg
r than behavior.
So the question that I pose to you, list, is this: is there any way to
change the way we're dealing with this problem to minimize the
disadvantages I mentioned above or is the answer "yup, that's pretty
much how you would need to set this up"?
Thanks again for all your feedback and attention folks, it has been
incredibly helpful.
Cheers,
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
clear up the potential confusion in this
behavior. Less confusion = happier devs
Cheers,
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/bin/spec:19:in
`'
What do I need to do to make things work?
Thanks in advance,
Paul Denlinger
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
My RSpec integration tests do not seem to have access to the rails
routes methods. Here's a link to my more descriptive question on stack
overflow:
http://stackoverflow.com/questions/3847102/routes-are-not-available-in-rspec-integration-test
Does anyone know how to fix this?
__
Hi Dean
it seems that you have sqlite3-ruby installed, but not sqlite3 installed ...
'gem install sqlite3' might fix it ?
cheers
Paul
On Thu, Nov 11, 2010 at 12:49 PM, Dean Richardson wrote:
> David:
>
> Thanks for your help. I've followed the set-up instruction
Hi Andrew
I suspect that flash[:error] is not a valid identifier, and therefore is
returning a nil value.
Hope this is of use to you.
Paul
On Mon, Nov 22, 2010 at 2:00 PM, Andrew Davis wrote:
> Hello everyone,
>
> I'm trying to write a failure test for updating a model, b
t a simple case of
'what's accessible in the controller is accessible in the controller spec'
(for example) ?, or is it more complicated ?
cheers
On Mon, Nov 22, 2010 at 9:55 PM, Robert Dober wrote:
> On Mon, Nov 22, 2010 at 4:04 PM, Paul Nelligan wrote:
> > Hi Andrew
&
oriented-design-with-ruby/tree/master/chapter_01
README for chapter 1 code:
https://github.com/pauldix/service-oriented-design-with-ruby/blob/master/chapter_01/README
I'll be updating the other code examples more today and in the coming
week. Let me know if there are any issues.
Thanks,
Pa
Generally I use the command line for testing. Netbeans can be a little
flakey. That said, check the config of your project in netbeans. Some of
the defaults applied by netbeans aren't always the correct options.
sent via Android mobile
On 10 Dec 2010 17:11, "George Dinwiddie" wrote:
> On 12/
Say I have a custom route like this...
map.connect 'item/:id/some_action', :controller => 'object', :action =>
'change_color', :conditions => {:method => :put}
I've been writing my tests like this...
describe ObjectController
describe "PUT item/:id/some_action" do
[...]
put :chang
lback by default for all tests on a
model and then re-enable it for specific tests that are testing the
geocoding functionality.
I'm using Rspec 2.5, Factory Girl and also Shoulda matchers.
Any tips greatly received.
Paul.
--
Posted via http://www.ruby-forum.com/.
r with unexpected arguments
expected: (:title, "funtitle")
got: (:title)
# ./app/helpers/application_helper.rb:5:in `title'
# ./spec/helpers/application_helper_spec.rb:9:in `block (3 levels)
in '
Can you see anything I'm doing wrong?
Thanks,
Paul
--
Po
Can any one give me an explanation on whats going on in this exercise.
And any advice on how i should go about it. I dont need any exact codes
just yet. But at least a good idea on how to start will be good
Thanks
Exercise 2: Gunfight at the OK Corral
Description
Overview
This exercise is
I've set my Rails (engine) project to include devise and other tools
like FactoryGirl.
I'd like to write some tests with contexts around anon/authenticated
users.
In my spec_helper.rb's RSpec.configure block, I have this:
config.include Devise::TestHelpers, type: :controller
Which gives me this,
Hi
I have the following code:
def will_paginate(items, options = {})
options = options.merge(:container => true, :class => 'paging')
super(items, options)
end
I am curious about how to test that the call to super is infact being called
with the added options.
I have this
it 'shou
Thanks Nick
the first approach seems the best for my situation.
Appreciate the response
Ivor
On Tue, Dec 9, 2008 at 4:45 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote:
> On 2008-12-09, at 06:29, Ivor Paul wrote:
>
>> Hi
>>
>> I have the following code:
>>
Hi
I found that if I set assigns[:variables] in a spec, the value is maintained
in subsequent specs.
Example
rails helper method:
def return_at_variable
@variable
end
Specs:
#this passes obviously
it 'should return true if assigns[:variable] is true' do
assigns[:variable] = true
Hi Guys
I am trying to spec some rails mailers.
The only info I found was this post
http://kpumuk.info/ruby-on-rails/testing-mailers-with-rspec/
by Dmytro Shteflyuk.
I am hoping there is somewhat more on the topic - could someone point
me towards a resource where I can find more?
Regards
Ivor
_
thanks a lot! This looks great.
On Sun, Dec 14, 2008 at 4:21 AM, Mischa Fierer wrote:
> I found this useful:
> http://madhatted.com/2008/7/10/rspec-real-world-testing
>
>
> On Thu, Dec 11, 2008 at 7:42 AM, Ivor Paul wrote:
>>
>> Hi Guys
>>
>> I am tryin
HI Andrew
I am getting the same problem. I only get it when I install
rspec-rails alongside rspec as gems.
Did you get a resolution to this problem?
Ivor
On Thu, Dec 4, 2008 at 10:54 AM, Andrew Premdas wrote:
> I've got a couple of rake tasks that seem to have broken with rspec 1.1.11.
> http:
The latest rspec-rails and rspec worked for me. Are you using the remarkable
gem?
On Fri, Dec 19, 2008 at 3:08 AM, Andrew Premdas wrote:
> No I don't think so. I'll post something when I next try and get the tasks
> to work
>
> 2008/12/17 Ivor Paul
>
> HI Andrew
Hi Guys
I am really having incredible issues with this error
i...@theluggage:~/workspace/talkies$ rake db:migrate
(in /home/ivor/workspace/talkies)
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/options.rb:229:in
`files_to_load': File or directory not found: db:migrate (RuntimeError)
I don't want to contaminate other features with
this particular venue setup (and it will be out of plain sight, which I
don't want either).
I am still new to BDD so please holler if I'm missing something fundamental.
-Paul
--
View this me
er limit should throw symbol :over_limit' FAILED
expected :over_limit but nothing was thrown
./spec/rspec_tests/rutabaga_spec.rb:125:
When the catch is removed, it works.
Can anyone reproduce this behavior?
thanks
Paul Mylchreest
paul.mylchre...@mac.com
___
18, 2009 at 12:19 PM, Paul
Mylchreest wrote:
Given
rspec 1.2.8
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
And the following spec:
def over_limit?(a)
catch(:over_limit) do
a.each do |x|
throw(:over_limit) if x > 10
end
end
end
describe "when ove
Cheers,
Marcus
Ahhh!! Great news. Thanks for that :-)
--
Paul Brackenridge
--
E - [EMAIL PROTECTED]
B - http://paulbrackenridge.com
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyf
.
Any help would be much appreciated.
Thanks,
P
[1] http://rspec.rubyforge.org/documentation/rails/install.html
--
Paul Brackenridge
--
E - [EMAIL PROTECTED]
B - http://paulbrackenridge.com
___
rspec
Is it possible to stub a Kernel method? I'm specifically interested in
the 'open' method to test some code using open-uri. I've tried:
Kernel.should_receive(:open).with('filename').and_return('data')
However, this doesn't seem to work. A
I have had this problem for a while.
autotest has never worked properly for me. I have tried different
versions of rspec with different versions of ZenTest. I have tried it
with .autotest files and without.
When I run autotest from my rails app root, it says:
loading autotest/rails_rspec
and
Nikolay Pavlov wrote:
>> http://blog.zenspider.com/archives/2008/01/zentest_version_391_has_been_
>>released.html
>>
>
> WOW. Thanks for quick response. :)
> Fixed.
>
> --
> ==
> - Best regards, Nikolay Pavlov. <<<---
Paul Cameron wrote:
> I have had this problem for a while.
>
> autotest has never worked properly for me. I have tried different
> versions of rspec with different versions of ZenTest. I have tried it
> with .autotest files and without.
>
> When I run autotest from my ra
igure { |config|
config.use_transactional_fixtures = false }
end
after(:all) do
Spec::Runner.configure { |config|
config.use_transactional_fixtures = true }
end
end
... but that doesn't work.
Thanks,
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://r
time I'm stuck waiting to see if my next spec will pass or not.
Is it possible to change that behavior somehow, so that it doesn't re-
run the entire suite every time?
Thanks,
Paul
___
rspec-users mailing list
rspec-users@rubyforge.org
http://r
Hi.
I am pretty new to rspec so forgive my ignorance.
I am getting errors that seem to be the matchers not working - example:
vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:478:in
`const_missing': uninitialized constant
Spec::Rails::Example::ModelExampleGrou
s.
Thanks for the help.
Ivor
On Tue, Jul 1, 2008 at 10:57 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Jul 1, 2008, at 3:48 PM, Ivor Paul wrote:
>
>> I am getting errors that seem to be the matchers not working - example:
>>
>>
>> vendor/rails/activerec
t for your help so far.
Regards
Ivor
On Wed, Jul 2, 2008 at 2:02 PM, Ivor Paul <[EMAIL PROTECTED]> wrote:
> Hi David
>
> thanks for the response!
> This is what the error looks like for be_valid
> /activesupport/lib/active_support/dependencies.rb:478:in
> `const_missing
49 matches
Mail list logo