You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
Translate the existing test cases in tests/test_logwork_manager.rb to rspec. You run specs with the following command: bundle exec rspec
Because LogworkIssue is a subclass of ActiveRecord::Base, it needs database initialization. For specs, you should stub (create a fake implementation) the Database.prepare_database method to establish a connection in memory instead of disk. This can be achieved with the following code: ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
Remove the /tests folder
To stub a method, use allow(...).to To make assertions, use expect(...).to
The text was updated successfully, but these errors were encountered:
billp
changed the title
Translate TestLogworkManager from minitest to specs
Translate TestLogworkManager from minitest to rspec
Feb 11, 2021
Tasks
bundle exec rspec
Database.prepare_database
method to establish a connection in memory instead of disk. This can be achieved with the following code:ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
To stub a method, use
allow(...).to
To make assertions, use
expect(...).to
The text was updated successfully, but these errors were encountered: