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 491033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:58:11+00:00 2026-05-13T01:58:11+00:00

My gem semantictext has a bunch of test data that it reads for regression

  • 0

My gem semantictext has a bunch of test data that it reads for regression testing.

Here’s the project: http://github.com/dafydd/semantictext

Here’s an example test that I want to be able to run directly from the gem: http://github.com/dafydd/semantictext/blob/master/test/test_document.rb (look for text “SANDBOX”)

I normally develop it in a directory called “semantictext” and have the environment variable SANDBOX set to the path of the directory above “semantictext” – so that I can reference any file in the project using ENV[‘SANDBOX’].

When the gem is installed as a package, is there a way that the test/unit test running from rake can:

1) know that it’s running from a gem? and

2) know the path to it’s semantictext directory within the local rubygems repository?

I want to make it effortless to be able to run all the tests from any gem installation. This would make my continuous integration a bit easier and allow me to write better gems.

Thanks,
Dafydd

  • 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-13T01:58:11+00:00Added an answer on May 13, 2026 at 1:58 am

    You can find out the directory of the current file using:

    File.dirname(__FILE__)
    

    This will allow you to build up a relative path to whatever file you need to access.

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

Sidebar

Related Questions

The ruby gem for LinkedIn that I'm using is here: http://github.com/pengwynn/linkedin When calling LinkedIn::Client.new
Gemfile: gem 'rails', '3.1.0.rc4' gem 'typus', :git => 'http://github.com/typus/typus', :branch => '3-1-unstable' Obviously the
is there a gem or plugin that will populate a database with test data?
A gem/plugin that I'm using to support my test suite calls some GNU commands
Gemfile: gem 'spree', '1.2.0' #:git => 'git://github.com/spree/spree.git' gem 'spree_auth_devise', :git => 'git://github.com/spree/spree_auth_devise' # original
For any gem that has dependencies, I get the following (with the names changed
I have this gem working such that I can change the id3 data for
I have a gem that has some ActiveRecord-derived models. They are tested and work.
I have a Rails gem that I am testing with RSpec. My gem's code
gem install heroku failed with following message and I have tried the solution here

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.