class GemHadar

def spec_task

depends on the :compile task if project extensions are present.
options, test pattern, and verbose output. The task also conditionally
suite. It initializes an RSpec::Core::RakeTask with appropriate Ruby
This method configures a :spec task that runs the project's RSpec test

The spec_task method sets up a Rake task for executing RSpec tests.
def spec_task
  defined? ::RSpec::Core::RakeTask or return
  st =  RSpec::Core::RakeTask.new(:run_specs) do |t|
    t.ruby_opts ||= ''
    t.ruby_opts << ' -I' << ([ spec_dir ] + require_paths.to_a).uniq * ':'
    t.pattern = spec_pattern
    t.verbose = true
  end
  task :spec => [ (:compile if extensions.full?), st.name ].compact
end