Ben J.,
Have you given up on this? You're right - that defeats the purpose of
Spork. You need to make sure that any code that loads code in your project
does not make it in to your Spork.prefork block. If you are specifically
loading the models in your environment, that's your problem.
Here's so
No, I didn't have that one, but had one similar problem where one of
my specs edited one non-Ruby file, which caused autotest to reload. I
solved that problem by explicitly ignoring it in autotest. I was
surprised that autotest cares about non-mapped files :)
But now I have another problem - it se
On 1 Jun 2009, at 20:52, Pat Maddox wrote:
You can do
it "should do something" do
some_precondition.should be_met
an_object.do_something
some_postcondition.should be_met
end
Also, more verbosely...
describe "when there is some precondition"
before(:each) do
do_stuff_which_attempts_
On Jun 1, 8:04 pm, Arthur Smith wrote:
> I thought the point was we don't want the examples to be run at all, if
> the condition is not met?
Yes.
>Though I'm wondering why not just handle
> something like this with a stub (on System.getProperty in this case)?
Because the examples need the info
Right, and in the code example I gave, if those preconditions fail
then the rest of the example won't be run. There's not really any
need for a new semantic element in RSpec, it already works this way
out of the box. You can do
it "should do something" do
some_precondition.should be_met
an_o
Let's say I've got this spec:
describe Team, "add_player" do
it "should add a player to the team" do
team = Team.new
player = Player.new :name => "Pat"
team.add_player player
team.should have(1).players
team.players.first.name.should == "Pat"
end
end
and for some reason
te
I thought the point was we don't want the examples to be run at all, if
the condition is not met? Though I'm wondering why not just handle
something like this with a stub (on System.getProperty in this case)?
Arthur Smith
Pat Maddox wrote:
You can put expectations in your before block,
You can put expectations in your before block, and that'll give you
the behavior you want.
before(:each) do
@org_root_prop = java.lang.System.getProperty("root")
@org_root_prop.should_not be_nil
@org_root_prop.trim.should_not be_empty
end
If either of those expectations fail then the ex
On Mon, Jun 1, 2009 at 7:26 AM, mortench wrote:
> Correction for last msg:
>
> before(:all) do
> �...@org_root_prop = java.lang.System.getProperty("root")
>
> # abort all examples and after action if condition is not meet:
> ensure_that !...@org_root_prop.nil? && @org_root_prop.strip.lengt
Correction for last msg:
before(:all) do
@org_root_prop = java.lang.System.getProperty("root")
# abort all examples and after action if condition is not meet:
ensure_that !...@org_root_prop.nil? && @org_root_prop.strip.length>0
end
/Morten
Hi David,
Thanks for the suggestion! It indeed make sense for the Junit
example... However, my particular usage case for assumption is a bit
different. I am using jruby+jspec and I have a group of rspec examples
that all require a java property to be set for the examples to be able
to run. Besides
On Mon, Jun 1, 2009 at 5:33 AM, mortench wrote:
> JUnit 4.4+ has a feature called assumptions and I am looking for
> something similar in rspec so that I can express that my examples
> require a specific environment variable to be specified for testing to
> make sense.
There is no explicit suppor
JUnit 4.4+ has a feature called assumptions and I am looking for
something similar in rspec so that I can express that my examples
require a specific environment variable to be specified for testing to
make sense.
About assumptions from the readme (http://junit.sourceforge.net/doc/
ReleaseNotes4.4
13 matches
Mail list logo