Created
September 5, 2020 23:54
-
-
Save stephaneliu/04629f6e6c94bd11efc8f6976cc6a3d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test < Thor | |
include Thor::Actions | |
desc "insert", "an example" | |
def insert | |
content = <<~EOL | |
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }\n\n | |
EOL | |
insert_into_file("spec/rails_helper.rb", content, before: "RSpec.configure do") | |
end | |
desc "uncomment", "an example" | |
def uncomment | |
uncomment_lines("spec/spec_helper.rb", /disable_monkey/) | |
uncomment_lines("spec/spec_helper.rb", /filter_run_when_matching/) | |
uncomment_lines("spec/spec_helper.rb", /example_status_persistence_file_path/) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thor test:insert
or
thor test:uncomment