OK, I tried to implement #module_exec on ruby 1.8.6, and here's what I
came up with:
http://github.com/myronmarston/rspec-core/commit/364f20ebd5b7d9612227cb6e86a6e8c8c2e9931e
It works (at least in the sense that it allows the specs and features
I added in the previous commits in that branch to pa
> If we do this, we should use module_exec for both blocks so they both get the
> same arguments.
I actually find the use of this to be a bit confusing:
[:foo, :bar].each do |arg|
it_should_behave_like "Something", arg do |a|
# The value of the param is already bound to arg and now it's
bo
On Aug 1, 2010, at 5:12 PM, Ashley Moran wrote:
>
> On 1 Aug 2010, at 3:43 PM, David Chelimsky wrote:
>
>> shared_examples_for "blah" do |a,b|
>> ...
>> end
>>
>> it_should_behave_like "blah", 1, 2
>>
>> That wouldn't have worked with the old implementation, but it would work
>> perfectly we
On Aug 1, 2010, at 5:39 PM, Myron Marston wrote:
>> Seems like your mental model is that of a customization block being a
>> subclass or re-opening of the shared block. What you say makes sense in that
>> model, but that's not the same model I have.
>
> My mental model is indeed that the custom
> Seems like your mental model is that of a customization block being a
> subclass or re-opening of the shared block. What you say makes sense in that
> model, but that's not the same model I have.
My mental model is indeed that the customization block is like a
subclass. I'm not sure where I g
On 1 Aug 2010, at 3:43 PM, David Chelimsky wrote:
> shared_examples_for "blah" do |a,b|
> ...
> end
>
> it_should_behave_like "blah", 1, 2
>
> That wouldn't have worked with the old implementation, but it would work
> perfectly well now. This would also "just work" with hash-as-keyword-args:
On Aug 1, 2010, at 11:40 AM, Myron Marston wrote:
>> The particular issue of simple values being used in the docstrings and the
>> examples themselves (i.e. exposed to everything in the block scope) could be
>> handled like this:
>>
>> shared_examples_for "blah" do |a,b|
>> ...
>> end
>>
>>
> The particular issue of simple values being used in the docstrings and the
> examples themselves (i.e. exposed to everything in the block scope) could be
> handled like this:
>
> shared_examples_for "blah" do |a,b|
> ...
> end
>
> it_should_behave_like "blah", 1, 2
Fantastic idea. I'm sold.
On Jul 31, 2010, at 1:06 PM, Myron Marston wrote:
>> You can still get the same outcome, but you have to implement it in the
>> group like this:
>
>> unless defined?(:foo)
>> def foo; "foo"; end
>> end
>
> Good point--I hadn't thought of that. The one issue I see with it is
> that the author
On Aug 1, 2010, at 9:43 AM, David Chelimsky wrote:
>
> On Jul 31, 2010, at 1:06 PM, Myron Marston wrote:
>
>>> You can still get the same outcome, but you have to implement it in the
>>> group like this:
>>
>>> unless defined?(:foo)
>>> def foo; "foo"; end
>>> end
>>
>> Good point--I hadn't t
On Jul 31, 2010, at 7:06 pm, Myron Marston wrote:
> I think this is a clunky way to essentially pass a parameter to the
> shared example group. Better would be something like this:
>
> it_should_behave_like "something" do
> providing :method_name, :foo
> end
After sleeping on this, I found an
11 matches
Mail list logo