Can oucumber and rspec use the same blueprints.rb file

I use Rails 3, driver 2, cucumber and rspec together and have two blueprints.rb files. One in the specs catalog and one in the features / support catalog.

Is it good to have only one blueprints.rb file?

If so, what is the preferred way to configure it?

In the meantime, I just reference my functions / support file /blueprints.rb to spec / blueprints.rb, which may be bad, but it works for me.

+3
source share
2 answers

I have it inside functions / support

file name machinist.rb

require 'machinist/active_record' 

Dir[ File.dirname(__FILE__) + "/../../spec/blueprints/*"].each {|file| require file }

Before { Sham.reset } # to reset Sham seed between scenarios so each run has same random sequences
+5
source

This, of course, sounds sensible - we do it for general appliances and assistants (but I do not use a driver).

, , , ​​ cucumber env rspec. , blueprints.rb, Ruby .

$: << File.expand_path(File.join(File.dirname(__FILE__), "..","..","shared","directory"))
#require 'blueprints' will now look in the above directory first

"..", "..", "shared", "directory" , blueprints.rb.

+1

Source: https://habr.com/ru/post/1796597/


All Articles