def define_rspec_tasks!
      require 'rspec/core/rake_task'

      namespace(:spec) do
        desc "Verify all RSpec examples for #{gemspec.name}"
        RSpec::Core::RakeTask.new(:basic) do |t|
          t.pattern = spec_pattern
        end

        desc "Verify all RSpec examples for #{gemspec.name} and output specdoc"
        RSpec::Core::RakeTask.new(:specdoc) do |t|
          t.pattern = spec_pattern
          t.rspec_opts = ['--format', 'documentation', '--color']
        end

        desc "Run RCov on specs for #{gemspec.name}"
        RSpec::Core::RakeTask.new(:rcov) do |t|
          t.pattern = spec_pattern
          t.rcov = true
          t.rcov_opts = ['--exclude', '"spec/*,gems/*"', '--rails']
        end
      end

      desc "Verify all RSpec examples for #{gemspec.name} and output specdoc"
      task(:spec => ['spec:specdoc'])
    end
def define_rspec_tasks!
      require 'rspec/core/rake_task'

      namespace(:spec) do
        desc "Verify all RSpec examples for #{gemspec.name}"
        RSpec::Core::RakeTask.new(:basic) do |t|
          t.pattern = spec_pattern
        end

        desc "Verify all RSpec examples for #{gemspec.name} and output specdoc"
        RSpec::Core::RakeTask.new(:specdoc) do |t|
          t.pattern = spec_pattern
          t.rspec_opts = ['--format', 'documentation', '--color']
        end

        desc "Run RCov on specs for #{gemspec.name}"
        RSpec::Core::RakeTask.new(:rcov) do |t|
          t.pattern = spec_pattern
          t.rcov = true
          t.rcov_opts = ['--exclude', '"spec/*,gems/*"', '--rails']
        end
      end

      desc "Verify all RSpec examples for #{gemspec.name} and output specdoc"
      task(:spec => ['spec:specdoc'])
    end
Defines RSpec tasks