Check for RuboCop and RSpec modules in rake

When the gem is included in a wrapper application, the gems rake tasks
will be loaded. In the wrapper application the development dependencies
of the gem (such as RuboCop) will not be loaded. When running the rake
tasks of the wrapper app in development (or test) mode, these rake tasks
would fail because RuboCop/Rake would not be defined.

So the stronger guard conditions of defined?(ModuleName) are needed.

When running the engine's rake tasks on travis, these modules should be
loaded so body of these rake tasks should be evaluated (adding rspec and
rubocop onto the list of default rake tasks).