Be careful that whatever you're doing in the test is transparent. In this case, we are creating a model that has an 'attr' attribute, but it is not clear here what exactly is being tested and why this would fail, since the matcher is extracted to a method.

I would write this as 

~~~ ruby
define_model(:example, attr: :string).new.should_not validate_absence_of(:attr)
~~~

or even

~~~ ruby
attribute_name = :attr
model = define_model(:example, attribute_name => string)
model.new.should_not validate_absence_of(attribute_name)
~~~

or even

~~~ ruby
attribute_name = :attr
model = define_model_with_attribute(attribute_name)
model.new.should_not validate_absence_of(attribute_name)
~~~

Note how now we can see the symmetry: we define a model with a certain attribute, and then we test that the matcher fails against that attribute.