Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Translate TestLogworkManager from minitest to rspec #30

Open
billp opened this issue Feb 11, 2021 · 1 comment
Open

Translate TestLogworkManager from minitest to rspec #30

billp opened this issue Feb 11, 2021 · 1 comment
Assignees

Comments

@billp
Copy link
Owner

billp commented Feb 11, 2021

Tasks

  • Write specs for TestLogworkManager:
    • 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

@billp billp changed the title Translate TestLogworkManager from minitest to specs Translate TestLogworkManager from minitest to rspec Feb 11, 2021
@sotcha sotcha self-assigned this Feb 11, 2021
@create-issue-branch
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants