Thanks,
-David
That looks real sweet, Ryan. Here's hoping you'll be able to release
it eventually.
--
Manuel, que
piensa que eres una excelente persona y medra en torno a
http://simplelogica.net y/o http://simplelogica.net/logicola/
Recuerda comer mucha fruta y verdura.
I'm guessing that it creates a before block that stores some temporary value, then compares the new value with it later in the should block.
Hi Ryan,
This looks really cool, as I've had a similar desire as well.
The way I thought about it previously, was that I wanted some kind of
"around" block to wrap around the setup.
How does the should_differ_by macro work?
context "Some action" do
setup do
# do some stuff equivalent to 'some action'
end
should_change "Post.count", :from => 1, :to => 2
should_change "Post.count", :from => 1 # don't care what the end
result is as long as it's different than :from
should_change "Post.count", :to => 1 # don't care what :from is
as long as the end result matches :to
should_change "@post.attribute", :from => 'foo', :to => 'bar' #
the above examples would also work with a string or any other value
# only the :by option must be numeric
should_change "Post.count", :by => 1 # don't care what :from
or :to were, as long as the difference is 1
end
-D
> Would there be any change of another experimental branch where theMuz, I like the block syntax better than the lambda syntax, but I'm
> "Post.count" could be code and not a string? something like:-
having trouble thinking of use cases that make it worthwhile. Did you
have something specific in mind beyond IDE support?
Either way, I
suggest hashing out the eval'd string version first and experimenting
with additions afterward.
-D
On Jul 9, 2008, at 6:57 AM, Murray Steele wrote:
> Would there be any change of another experimental branch where the
> "Post.count" could be code and not a string? something like:-
>