ruby - What can I check to see if rspec is running? -



ruby - What can I check to see if rspec is running? -

so ruby libraries double executables, using trick:

if __file__ == $0 # deed executable... end

i'm writing mini-library, , wondering if there similar trick utilize embed rspec tests in file. sort of constant or check, like:

if rspec_target == $0 describe 'foo' "should foo" #... end end

argv contains name of script. utilize next in modules:

if argv.include? file.basename(__file__) # unit tests here end

ruby rspec

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -