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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:19:13+00:00 2026-05-27T00:19:13+00:00

In Java typically you would create two source folders src and test with an

  • 0

In Java typically you would create two source folders src and test with an identical package hierarchy.

In Ruby do you just put all the tests in the same folder as the class under test? Or do you create a similar hierarchy in a separate folder? If so, how do you manage the require paths in your unit tests?

  • 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-27T00:19:14+00:00Added an answer on May 27, 2026 at 12:19 am

    At first, each gem has a typical layout. Code is almost completely in lib. In the root directory, there is only metadata like the README, gemspec file and some optional configuration data. If you write a web app with something like Rails or Sinatra, their layout standards are used instead.

    In all those project types, tests can be found in similar locations though. Depending on which testing framework you use, there are different standards.

    If you use Test::Unit or minitest, tests usually are in a test directory. There are no real standards on how to actually organise the test files in that directory. I personally found it useful to at least partly mirror the file layout of the tested code. If you use modules/namespaces generously, that should make it rather readable when following this setup in your tests too.

    If you use RSpec, the tests (then called specs) go into a spec directory. The above notes about the layout of the actual tests apply here too.

    In the end, it’s mostly your own decision how you set up your tests. As tests are an area where many people have different (and strong) opinions, there’s no holy path to success. You should take a look at some gems you use and how they do stuff. An example of minitest layouts can be found in the Rails gems, e.g. for ActiveRecord. An example for RSpec tests is my rackstash library.

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

Sidebar

Related Questions

I am getting a NoClassDefFoundError when I run my Java application. What is typically
I'd like to create a set of buttons in a Java Swing application like
I would like to find a good (up-to-date) Java Trail type beginning tutorial on
I typically use Netbeans (but also STS) to develop my Java code but I've
I am working on a Java/Struts application that uses Tomcat 6.0.10. It's a typical
Java has generics and C++ provides a very strong programming model with template s.
Java has a convenient split method: String str = The quick brown fox; String[]
(Java question) If I reference a field in an inner class, does this cause
Java Newbie here. I have a JFrame that I added to my netbeans project,
Java is one of my programming languages of choice. I always run into the

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.