<commit_before>require "spec_helper"

describe "Adapter" do
  include_context "users and tasks" do
    before(:all) do
      Class.new(ROM::SQL::Adapter) do
        def self.schemes
          [:sqlite]
        end

        def extend_relation_class(klass)
          klass.class_eval do
            def self.freaking_awesome?
              true
            end
          end
        end

        def extend_relation_instance(relation)
          relation.instance_eval do
            def freaking_cool?
              true
            end
          end
        end

        ROM::Adapter.register(self)
      end
    end
  end

  before do
    setup.relation(:users)
  end

  it "can extend relation class" do
    expect(rom.relations.users.class).to be_freaking_awesome<commit_msg>Fix spec for jruby<commit_after>require "spec_helper"

describe "Adapter" do
  include_context "users and tasks" do
    before(:all) do
      Class.new(ROM::SQL::Adapter) do
        def self.schemes
          [:sqlite, :jdbc]
        end

        def extend_relation_class(klass)
          klass.class_eval do
            def self.freaking_awesome?
              true
            end
          end
        end

        def extend_relation_instance(relation)
          relation.instance_eval do
            def freaking_cool?
              true
            end
          end
        end

        ROM::Adapter.register(self)
      end
    end
  end

  before do
    setup.relation(:users)
  end

  it "can extend relation class" do
    expect(rom.relations.users.class).to be_freaking_awesome
{'fraction_non_alphanumeric': 0.06377551020408163, 'fraction_numerical': 0.0, 'mean_word_length': 1.682051282051282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1212444', 'n_tokens_mistral': 460, 'n_tokens_neox': 437, 'n_words': 111}