Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can I have RSpec without a class for methods

Tags:

ruby

rspec

I'm just writing some algorithm methods that I don't want to put in a class. So I just put them in my ruby file. But I cant figure out how to write test or more specifically use describe :xxx since I dont' have a class name to put after the main describe. Any ideas?

like image 456
Matilda Avatar asked Oct 02 '12 08:10

Matilda


1 Answers

You can put any string after the describe statement:

describe "Something You Want To Test" do
  # Your specs here
end
like image 123
Erez Rabih Avatar answered Oct 08 '22 09:10

Erez Rabih