Skip to content

Commit

Permalink
Initial refactoring/updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 30, 2024
1 parent 714de47 commit 1aef234
Show file tree
Hide file tree
Showing 28 changed files with 259 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "Samuel Williams"
${{matrix.env}} bundle exec rspec
bundle exec bake test
4 changes: 0 additions & 4 deletions .rspec

This file was deleted.

8 changes: 8 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env rackup
# frozen_string_literal: true

require_relative 'config/environment'

require 'financier/middleware'

Financier::Middleware.call(self, utopia: UTOPIA)
14 changes: 14 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require 'bundler/setup'
Bundler.setup

require 'utopia/setup'
UTOPIA ||= Utopia.setup

require_relative '../db/environment'

require 'financier'
require 'json'

require 'time/zone'
4 changes: 4 additions & 0 deletions config/sus.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'covered/sus'
include Covered::Sus

require_relative 'environment'
12 changes: 4 additions & 8 deletions financier.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ Gem::Specification.new do |spec|

spec.add_dependency "utopia", "~> 2.18"

spec.add_dependency "relaxo", "~> 1.3"
spec.add_dependency "relaxo", "~> 1.7"
spec.add_dependency "relaxo-model", "~> 0.19"

spec.add_dependency "periodical", "~> 1.0"
spec.add_dependency "latinum", "~> 1.3"
spec.add_dependency "periodical", "~> 1.2"
spec.add_dependency "latinum", "~> 1.8"

spec.add_dependency "time-zone", "~> 1.1"

spec.add_dependency "ofx", "~> 0.3"
spec.add_dependency "qif", "~> 1.1"
spec.add_dependency "csv", "~> 3.0"

spec.add_dependency "bcrypt", "~> 3.0"

Expand All @@ -40,9 +41,4 @@ Gem::Specification.new do |spec|
spec.add_dependency "markly"

spec.add_dependency "tty-prompt"

spec.add_development_dependency 'covered'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'bake-bundler'
end
39 changes: 39 additions & 0 deletions fixtures/website.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2016-2023, by Samuel Williams.

require 'rack/test'
require 'sus/fixtures/async/http'
require 'protocol/rack'

AWebsite = Sus::Shared("a website") do
include Rack::Test::Methods

let(:rackup_path) {File.expand_path('../config.ru', __dir__)}
let(:rackup_directory) {File.dirname(rackup_path)}

let(:app) {Rack::Builder.parse_file(rackup_path)}
end

AValidPage = Sus::Shared("a valid page") do |path|
it "can access #{path}" do
get path

while last_response.redirect?
follow_redirect!
end

expect(last_response.status).to be == 200
end
end

AServer = Sus::Shared("a server") do
include Sus::Fixtures::Async::HTTP::ServerContext

let(:rackup_path) {File.expand_path('../config.ru', __dir__)}
let(:rackup_directory) {File.dirname(rackup_path)}

let(:rack_app) {Rack::Builder.parse_file(rackup_path)}
let(:app) {Protocol::Rack::Adapter.new(rack_app)}
end
Loading

0 comments on commit 1aef234

Please sign in to comment.