# Doubt regarding Testing with RSpec

**URL:** <https://www.ruby-forum.com/t/doubt-regarding-testing-with-rspec/190436>\
**Category:** Ruby\
**Created:** [June 20, 2010, 5:50am UTC](https://www.ruby-forum.com/t/doubt-regarding-testing-with-rspec/190436 "2010-06-20T05:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narayanan\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@Narayanan\_K](https://www.ruby-forum.com/u/Narayanan_K)\
**Post date:** [June 20, 2010, 5:50am UTC](https://www.ruby-forum.com/t/doubt-regarding-testing-with-rspec/190436/1 "2010-06-20T05:50:54Z")

</div>

Hi all,

I have a library of RSpec Test examples. Now, from an upper ruby layer,  
I  
need to run only individual separate test example from the library that  
matches a particular string in the upper layer.

For Example:

My RSpec library file contains many test examples like:

\*describe arithmetic do

it “should provide a sum of two numbers” do  
(1 + 2).should == 3  
end

it “should provide a difference of two numbers” do  
(5-4).should == 1  
end

…  
…  
…

end

_Now there is a ruby layer above from where I need to run the first test  
i.e  
when my input is test\_add the \* it "should provide a sum of two  
numbers"must only run and give me results of test.  
Similarly, if in the input I am accepting in my upper ruby code is \*  
test\_subtract, the 2nd test must run \* (it “should provide a difference  
of  
two numbers”)_ and show the result of test.

Is this possible with RSpec ?

Thanks in advance,

Regards,  
Narayanan
