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

  • Home
  • SEARCH
  • 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 8807049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:16:45+00:00 2026-06-14T02:16:45+00:00

So, while I like Cucumber for its readability for integration testing and its ability

  • 0

So, while I like Cucumber for its readability for integration testing and its ability to give us documentation we can share with the client easily, I also find it cumbersome from the development and testing speed standpoints.

I got to thinking today that if I could just print out messages to the RSpec documentation format that documented the “steps”, then I could easily replicate the business features of Gherkin but in the simplicity of RSpec. But I can’t figure out a way to do this.

What I want is to take something like this:

describe "Login and Authorization Tests" do
  before (:each) do
    docs "Given I have a user"
    @user = FactoryGirl.create(:user)
  end

  it "A user can belong to one or more user roles" do
    docs "And the user has no roles assigned"
    @user.roles.length.should eq 0
    docs "When I add two roles"
    @user.roles << FactoryGirl.create(:role)
    @user.roles << FactoryGirl.create(:role)

    @user.reload
    docs "Then the user should have two roles assigned"
    @user.roles.length.should eq 2        
  end
end

and get this in the documentation

User
  Login and Authorization Tests
    A user can belong to one or more user roles
      Given I have a user
      And the user has no roles assigned"
      When I add two roles
      Then the user should have two roles assigned

Note that the message from “before” shows up in the docs too, and would show up with that line in every test below it.

I’m thinking of forking to see if I can add something like this in, but before I did that, does anyone know if something like this is possible already?

  • 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-06-14T02:16:47+00:00Added an answer on June 14, 2026 at 2:16 am

    I also contacted the RSpec dev team and someone there posted this add-on called rspec-longrun that could be repurposed for this. I haven’t had a chance to try it yet, but it looks very promising. And as a bonus, it includes timing information.

    rspec-longrun: https://github.com/mdub/rspec-longrun

    Thread on rspec-dev: https://github.com/rspec/rspec-dev/issues/34

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

Sidebar

Related Questions

Can somebody please explain why a while statement like while (ch != '\n' ||
How anyone can write an Indefinite running Thread without a costly loop like while?
While running a cucumber test, I need to know the local testing server address.
In Perl you can write something like while(!eof){ doSomething(x,y); print $_; } and the
How can I do this? I just wish to write something like while(true) {
Looks like while( condition ) { //do stuff } is completely equivalent to for(
Is if(a) { do { b(); } while(a); } exactly like while(a) { b();
Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I have part of my script that goes like this: while read line do
I'm writing some code that looks like this: while(true) { switch(msg->state) { case MSGTYPE:

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.