```ruby
if defined?(ChefSpec)

  {
    rbenv_gem: [:install, :upgrade, :remove, :purge],
    rbenv_global: [:create],
    rbenv_plugin: [:install],
    rbenv_rehash: [:run],
    rbenv_ruby: [:install, :reinstall],
    rbenv_script: [:run],
  }.each do |resource, actions|
    actions.each do |action|
      define_method("#{action}_#{resource}") do |name|
        ChefSpec::Matchers::ResourceMatcher.new(resource, action, name)
      end
    end
  end

end
```

Add chefspec matcher for rbenv install
user
```ruby
if defined?(ChefSpec)

  {
    rbenv_gem: [:install, :upgrade, :remove, :purge],
    rbenv_global: [:create],
    rbenv_plugin: [:install],
    rbenv_rehash: [:run],
    rbenv_ruby: [:install, :reinstall],
    rbenv_script: [:run],
    rbenv_system_install: [:install],
    rbenv_user_install: [:install],
  }.each do |resource, actions|
    actions.each do |action|
      define_method("#{action}_#{resource}") do |name|
        ChefSpec::Matchers::ResourceMatcher.new(resource, action, name)
      end
    end
  end

end
```
assistant