diff --git a/Gemfile b/Gemfile index 574537c..dadf7ff 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,12 @@ -source "https://rubygems.org" +# frozen_string_literal: true + +source 'https://rubygems.org' -gem "roda" gem 'rake' +gem 'roda' # change to gunicorn or passenger if you prefer: -gem "puma" +gem 'puma' group :development do gem 'rerun' diff --git a/Rakefile b/Rakefile index 9c36f14..f791949 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'rake/testtask' Rake::TestTask.new do |task| task.pattern = '*_test.rb' -end \ No newline at end of file +end diff --git a/app.rb b/app.rb index c8d8a2e..626e73c 100644 --- a/app.rb +++ b/app.rb @@ -1,16 +1,16 @@ # frozen_string_literal: true -require "roda" +require 'roda' + +# A simple Roda app all in one file. class App < Roda route do |r| - r.root do - "My Homepage" + 'My Homepage' end r.get 'about' do - "About This Site" + 'About This Site' end - end end diff --git a/app_test.rb b/app_test.rb index 20ff798..23db382 100644 --- a/app_test.rb +++ b/app_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'minitest/autorun' require 'capybara/minitest' @@ -5,7 +7,8 @@ require_relative 'app' Capybara.app = App -class AppTest < Minitest::Test +# Run tests for my simple Roda app. +class AppTest < Minitest::Test include Capybara::DSL include Capybara::Minitest::Assertions @@ -33,13 +36,12 @@ class AppTest < Minitest::Test # Can change the checked content as your site evolves: def test_home_page_has_content visit '/' - assert_content "My Homepage" + assert_content 'My Homepage' end def test_about_page_exists_and_has_content visit '/about' assert_equal 200, page.status_code - assert_content "About This Site" + assert_content 'About This Site' end - end diff --git a/config.ru b/config.ru index c9fa468..cc2c69b 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ -require "./app" +# frozen_string_literal: true + +require './app' run App.freeze.app