Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 225625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:25:54+00:00 2026-05-11T19:25:54+00:00

I was looking through the Datamapper directories and opened up dm-core/tasks/dm.rb . Just generally

  • 0

I was looking through the Datamapper directories and opened up dm-core/tasks/dm.rb. Just generally speaking, what the heck is going on in this file? It looks like Greek to me. Particularly this thing about “specs” – what are those for? Is that similar to a software spec which defines what a project is supposed to encompass?

require 'spec/rake/spectask'
require 'spec/rake/verify_rcov'

task :default => 'spec'

RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
  t.threshold = 87.7 # Make sure you have rcov 0.7 or higher!
end

def run_spec(name, files, rcov)
  Spec::Rake::SpecTask.new(name) do |t|
    t.spec_opts << '--options' << ROOT + 'spec/spec.opts'
    t.spec_files = Pathname.glob(ENV['FILES'] || files.to_s).map { |f| f.to_s }
    t.rcov = rcov
    t.rcov_opts << '--exclude' << 'spec'
    t.rcov_opts << '--text-summary'
    #t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
    #t.rcov_opts << '--only-uncovered'
    #t.rcov_opts << '--profile'
  end
end

public_specs     = ROOT + 'spec/public/**/*_spec.rb'
semipublic_specs = ROOT + 'spec/semipublic/**/*_spec.rb'
all_specs        = ROOT + 'spec/**/*_spec.rb'

desc 'Run all specifications'
run_spec('spec', all_specs, false)

desc 'Run all specifications with rcov'
run_spec('rcov', all_specs, true)

namespace :spec do
  desc 'Run public specifications'
  run_spec('public', public_specs, false)

  desc 'Run semipublic specifications'
  run_spec('semipublic', semipublic_specs, false)
end

namespace :rcov do
  desc 'Run public specifications with rcov'
  run_spec('public', public_specs, true)

  desc 'Run semipublic specifications with rcov'
  run_spec('semipublic', semipublic_specs, true)
end

desc 'Run all comparisons with ActiveRecord'
task :perf do
  sh ROOT + 'script/performance.rb'
end

desc 'Profile DataMapper'
task :profile do
  sh ROOT + 'script/profile.rb'
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:25:55+00:00Added an answer on May 11, 2026 at 7:25 pm

    What you actually have there is a rake file that calls the rspec tests. The actual specs would be in files named foo_spec.rb and are a lot more readable.

    RSpec is a framework for Behaviour Driven Development (BDD) and is used as an alternative to testunit the traditional Unit Testing framework in Ruby.

    The real benefit to using BDD over traditional unit testing is one of having readable tests that quite literally read as specs.

    I often sit with non technical clients and read through the spec source file to see if they make sense to them or if there are any rules missing. In almost all cases they can follow them intelligently.

    Here is a silly simple example:

    describe User do
      describe "basic generation" do
        before(:each) do
          @user=User.create :first_name=>"Bob, :last_name=>"Smith"
        end
    
        it "should be valid" do
          @user.should be_valid
        end
    
        it "should have a full name" do
          @user.full_name.should=="Bob Smith"
        end
      end
    end
    

    As the other poster said, go to the RSpec web site for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking through some java code and this just does not seem right. To me,
Looking through this C++ BigInt library and found the BigInt.cpp file. At the top
I'm looking through some code for learning purposes. I'm working through this portion of
So I'm looking through some code, and I see this: class whatever { public:
Looking through the dom.js source from the Closure library I found this (in goog.dom.getElementsByTagNameAndClass_
After looking through W3Schools I'm still not sure if this is possible or not.
Looking through PIL (and related to this question ), where can I get a
Looking through the Android SDK framework source code, I've come across this: private final
Just looking through the newly released Gingerbread documents and I see they've added some
After looking through the questions on this site and doing a few internet searches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.