Skip to content

Commit

Permalink
fix: Conserta execução dos testes (#62)
Browse files Browse the repository at this point in the history
* fix: conserta execução dos testes

* fix: conserta testes na CI
  • Loading branch information
natannobre authored Sep 17, 2024
1 parent 92266c1 commit 086f535
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
run: RAILS_ENV=test bundle exec rails db:migrate

- name: Run tests
run: bundle exec rspec
run: bundle exec rspec --require spec_helper --require rails_helper
4 changes: 1 addition & 3 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
--require spec_helper
--require rails_helper
--format documentation
--require spec_helper
25 changes: 25 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir APP_ROOT do
puts "\n== Running RSpec =="
if ARGV.first&.include?("--auto")
unless system("gem list retest -i --silent")
puts "Installing retest..."
system("gem install retest")
end

puts "retest 'bundle exec rspec <test>'"
system "retest 'bundle exec rspec <test>'"
else
puts "bundle exec rspec #{ARGV.join(' ')}"
system "bundle exec rspec #{ARGV.join(' ')}"
end
end

0 comments on commit 086f535

Please sign in to comment.