Displaying 20 results from an estimated 8000 matches similar to: "Any plans for Before-feature or Before-all steps in Cucumber?"
2008 Nov 04
18
Can I do foo.should (be_nil || be_empty) in rspec
Is there any way to do
foo.should (be_nil || be_empty)
in rspec.
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/ee43c9c9/attachment.html>
2008 Dec 03
3
Intermittent Cucumber exception
Hi
Anyone recognise this exception, and know what causes it to happen
occasionally?
Thanks
Ashley
Scenario: new story appears on
feed # features/descriptions/
story_notification.feature:12
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.10/bin/../lib/cucumber/
broadcaster.rb:15:in `write'': Bad file descriptor (Errno::EBADF)
from
2008 Nov 04
8
Testing a wizard with Cucumber
Assuming you have a multi-step wizard like thing, with lots of different
states and paths through it. What approach would your use to write a feature
for it? What I want to do is do the separate states and then reuse these
things in more complex scenarios that cover paths. For example
Scenario: State A
Given I''m ...
And I''m ...
When I ...
Then I should see
And I at
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values.
For example I would like to convert this:
@siteItem = stub(''plmSiteItem'', :one => "uno")
To something like this:
@siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} )
So that I can do this:
2009 Oct 14
14
spec-ing private methods?
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor <scott at railsnewbie.com> wrote:
>
> On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote:
>
> hello there,
> how do you tipically spec private methods? The thing is ? have something
> like this:
>
> def some_method
> ?? complex_method + other_complex_methods
> end
>
> private
> def complex_method...
2008 May 27
8
new --pattern option
Hello.
You''re saying that:
To get rspec to behave as it did before this change, use this:
--pattern "**/*.rb"
I tried like this (rspec 1.03) and it wasn''t same as before (rspec 1.08).
Now it also loads all other files in current directory and in all
subdirectories and not only from directory and subdirectories given to spec
as a parameter.
So, for example, I have
2008 May 20
4
mock_model not stubbing model attribtues in view spec
Hi -- I am just getting to grips w/ view specs, and am having an issue
with mock_model not stubbing the mocked model''s attributes.
For instance, I have the following:
<CODE>
before do
@input_timesheet = mock_model( InputTimesheet )
assigns[:input_timesheet] = @input_timesheet
end
it "should display a table element" do
render
2008 Apr 29
5
Sharing: dont_repeat_yourself plugin custom RSpec matcher
I wrote a Rails plugin which uses simian to look for duplicates lines in your
code and reports in html format, Textmate or Netbeans.
I wrote it using RSpec and I have included a RSpec custom matcher:
it { rails_application.
with_threshold_of_duplicate_lines(4).
should be_DRY }
If you use Autotest, your specs will fail the next time you do a nasty
copy-paste !!!
More details in
2009 Jan 17
10
Cucumber Scenario Outlines Output Insufficient
I''m having problems knowing what a scenario outline I''ve created is doing.
In particular I have no idea about what steps are being matched when the
outline is run so when I break something I can''t find out what is wrong. Is
there any progress on getting better output for scenario outlines.
TIA
Andrew
-------------- next part --------------
An HTML attachment was
2008 Nov 07
6
How to spec a (Trollop-based) binary’s internal state?
I?m trying to spec a ?binary?, and as previously discussed on this list,
I?m trying to do it ?from outside? ? i.e., by calling it with Kernel#`
and observing the (side-)effects.
Unfortunately, this doesn?t really let me spec expectations about its
internals. Let?s assume I have a -d flag and I parse it with Trollop to
set Conf.debug:
opts = Trollop::options do
opt :debug, ''Print debug
2008 May 18
2
Using Hash to mock classes that respond to :
Hi
I''ve been doing this a while now. If I have a class that responds to :
[], and all I''m interested in stubbing is that method, then instead of
using a mock I just create a hash. (Similarly, you could create an
array when you are testing an Enumerable object.)
Example from code I just worked on, where uses MigrationGraph#[] looks
up graph vertices by name:
2008 Mar 13
22
Specifing methods in a steps_for block
Hey list,
I''m refactoring some much-used functionality into a common_steps step
group. Methods like this are in there:
steps_for :common do
Given "a number of existing $types?" do |type|
@initial_item_count = type.singularize.classify.constantize.count
end
When "the user adds an invalid $type" do |type|
post
2009 Jan 05
7
[Cucumber] after feature hook?
Hi,
Is there a hook or a method to execute some code after a whole feature
has run or will I need to embed that in a ''Then''?
Regards
Aidy
2009 Mar 31
7
[Cucumber] Running single feature from command line
I am using Cucumber 0.2.3 and am having problems running a single
feature. In particular, the cucumber Textmate bundle was not working
so I traced it back and discovered that I could not run single files
or features from the command line either. My setup has the following
line in cucumber.yml
default: -r features/support/env.rb -r features/support/plain.rb -r
features/steps
2008 Mar 17
8
should have_tag outside Rails
Hi
Google has not helped me here. I''m looking for a way to use the have_tag
assert_select wrapper outside RSpec on Rails (but in a Rails project) so I
can use it to check text strings.
Has anyone managed this?
Thanks
Ashley
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Nov 24
8
Cucumber Custom Logging
Where and how do you put custom logger statements in cucumber? I
understood (more or less) how to do this in rspec in the spec_helper
file but I do not know where to start with cucumber.
I want to add a simple identifying text line in the log file to assist
in picking through the output. Something akin to:
Running Scenario: X
Feature I should have this logged
....
Feature This should
2008 Nov 04
9
RSpec and PostgreSQL not playing nicely together
Here is a very simple spec:
--
require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'')
describe Product, "The Product model" do
describe "When a new blank product object gets created" do
before(:each) do
@product = Product.new
end
it "should not be valid" do
@product.should_not be_valid
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
--
Sent from my mobile device
2007 Oct 17
15
Any tips on teaching BDD with RSpec?
Hi
I hope this is not OT. I''m training my replacement at work to do BDD
Rails development. He''s done a CS/maths degree but has no
professional programming experience, so he''s never NOT done a project
without BDD. In a way I am jealous of his unspoilt situation :)
I''ve gone about things this way:
* first teach him some Ruby (he did mainly Java at
2007 Feb 22
9
specking, speccing, or spec''ing
I vote for spec''ing.
Anybody else?