I am not really sure all this meta programming buys you much. It's harder to read, harder to find, harder to modify (for just one of the two conditions of include/exclude). Is the first example below really that much better?

```ruby
[:includes, :excludes].each do |m|
    define_method("test_package_name_#{m}") do
      units = {:units => [{:name => "foo*"}, {:name => "goo*"}]}
      expected = [{"name"=>{"$regex"=>"foo*"}}, {"name"=>{"$regex"=>"goo*"}}]
      send("exec_test_#{m}", "rpm", units, expected )
    end
  end
```

```ruby
    define_method("test_package_name_#{m}") do
      units = {:units => [{:name => "foo*"}, {:name => "goo*"}]}
      expected = [{"name"=>{"$regex"=>"foo*"}}, {"name"=>{"$regex"=>"goo*"}}]
      exec_test_include("rpm", units, expected)
      exec_test_exclude("rpm", units, expected)
    end
```