-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Parr
committed
May 28, 2022
0 parents
commit 4f1ab57
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.0' | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install -g npm | ||
sudo apt-get -yqq install libsqlite3-dev libpq-dev libmysqlclient-dev | ||
gem install rails | ||
# Clean up git repo so the new rails template doesn't conflict | ||
- name: Remove git repo | ||
run: | | ||
rm -rf .git | ||
- name: Run tests | ||
run: | | ||
rake |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0.3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
A Rails Application Template for use at Ministry of Velocity | ||
|
||
Reference: [Rails Application Templates](https://guides.rubyonrails.org/rails_application_templates.html) | ||
|
||
|
||
Thank you to the following open source projects for inspiration and setup: | ||
|
||
[Jumpstart](https://github.com/excid3/jumpstart). | ||
[https://github.com/mattbrictson/rails-template](https://github.com/mattbrictson/rails-template) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << "test" | ||
t.libs << "lib" | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
end | ||
|
||
task :default => :test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
def rails_version | ||
@rails_version ||= Gem::Version.new(Rails::VERSION::STRING) | ||
end | ||
|
||
def rails_7_or_newer? | ||
Gem::Requirement.new(">= 7.0.0").satisfied_by? rails_version | ||
end | ||
|
||
def add_gems | ||
|
||
end | ||
|
||
unless rails_7_or_newer? | ||
say_error "-----------------------------", :red | ||
say_error "Please use Rails 7.0 or newer", :red | ||
say_error "-----------------------------", :red | ||
# raise 'hell' | ||
end | ||
|
||
add_gems | ||
|
||
after_bundle do | ||
say "App successfully created!", :green | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require "minitest/autorun" | ||
|
||
class TemplateTest < Minitest::Test | ||
def setup | ||
system("[ -d test_app ] && rm -rf test_app") | ||
end | ||
|
||
def teardown | ||
setup | ||
end | ||
|
||
def test_generator_succeeds | ||
output, error = capture_subprocess_io do | ||
system("rails new test_app -m template.rb") | ||
end | ||
assert_includes output, "App successfully created!" | ||
# puts error | ||
end | ||
end |