Open hosh opened 14 years ago
I think I found a solution. Instead of trying to override describe, I think introducing a new example-group level semantics would work:
describe Post do
with_attributes :published => true do
it { should act_in_a_different_way }
end
end
While it adds to the namespace, I think that was where Rspec2 was going, with the pending example groups and metadata.
I like this much much better. I never used describe :title => 'Blah' because it felt dirty to use a method that overrides an RSpec core method.
I would, however, use with_attributes.
I've been playing with something like this with using only let() and Rspec2 metadata with Rack-level specs. https://gist.github.com/741657dae42ae9706672 It works pretty well.
Remarkable 3.3:
This does not exist in Remarkable 4.0.0.alpha1. Rspec2 has a metadata system that lets you do this:
describe Post, :extra_fields => whatever do describe "when pending", :pending => true end
end
So there is some conflict with this system. At the minimum, subject_attributes would have to be implemented through metadata.
I've cut this out from Remarkable::ActiveRecord, but I'm noticing this is the heart of the Remarkable::Rails macros.
So folks, suggestions from people who use these features are definitely welcomed.