I'm trying to do something like the following:
@special_attributes = Model.new.methods.select # a special subset
@special_attributes.each do |attribute|
context "A model with #{attribute}" do
setup do
@model = Model.new
end
should "respond to it by name" do
assert_respond_to @model, attribute
end
end
end
However, @special_attributes is out of scope when running the unit tests, leaving me with a nil object on line 2. I can't figure out where/how to define it to bring it in scope. Any thoughts?