Are Ruby classes removed between Rake tasks

I have a Rakefile that defines the spec task as

task :spec => [:check_dependencies, :load_backends]

And then runs the actual rspec tests. During the load_backends task, it loads a class with the name Story, but in the first test spec, defined?(Story)returns false.

I assume that Rake’s intended behavior begins with a new environment at the beginning of each task, but is there a way to override this? Or do I need to reverse engineer the loading of backends in every task?

+3
source share
1 answer

RSpec spec Ruby ( , Rake, ), , rake ( ), . spec RSpec spec.

+1

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


All Articles