Have a look at `kernel_parameter_grub2_spec.rb` which uses a command (grub2-mkconfig).  What happens when you use `commands` or `optional_commands` is it defines a method on the class by that name, which then calls the binary.  So in the grub2 provider spec, it uses this to stub the "mkconfig" method that gets created:

    provider_class.any_instance.expects(:mkconfig).with("-o", "/boot/grub2/grub.cfg")

If you change the sysctl_get and _set methods to be on the object rather than class (remove `self.`) then the above should work too if you change it to stub `:sysctl`.