diff --git a/lib/oaken.rb b/lib/oaken.rb index 7ebee21..0dad8cd 100644 --- a/lib/oaken.rb +++ b/lib/oaken.rb @@ -83,7 +83,7 @@ def self.load_from(directory) class Result def initialize(directory) @directory = directory - @path = Pathname.new("./tmp/oaken-result.yml") + @path = Pathname.new("./tmp/oaken-result-#{Rails.env}.yml") @runs = @path.exist? ? YAML.load(@path.read) : {} @runs.transform_values! { Run.new(**_1) } @runs.default_proc = ->(h, k) { h[k] = Run.new(path: k) } diff --git a/test/dummy/test/models/account_test.rb b/test/dummy/test/models/account_test.rb new file mode 100644 index 0000000..f216909 --- /dev/null +++ b/test/dummy/test/models/account_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class AccountTest < ActiveSupport::TestCase + test "something" do + assert accounts.kaspers_donuts + end +end + diff --git a/test/dummy/test/test_helper.rb b/test/dummy/test/test_helper.rb new file mode 100644 index 0000000..98d9b2c --- /dev/null +++ b/test/dummy/test/test_helper.rb @@ -0,0 +1,16 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +Oaken::Seeds.preregister ActiveRecord::Base.connection.tables.grep_v(/^ar_/) +Oaken::Seeds.load_from "db/seeds/accounts/kaspers_donuts" + +class ActiveSupport::TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + include Oaken::Seeds +end