Sha256: 754490b401893769035488a909c67613366acdf291fa3e8e5b24cb3cc6d1f21e

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require "rails_helper"

RSpec.describe DefraRubyEmail do
  describe "VERSION" do
    it "is a version string in the correct format" do
      expect(DefraRubyEmail::VERSION).to be_a(String)
      expect(DefraRubyEmail::VERSION).to match(/\d+\.\d+\.\d+/)
    end
  end

  describe "#configuration" do
    before(:each) { Helpers::Configuration.reset_for_tests }

    context "when the host app has not provided configuration" do
      let(:enabled) { false }

      it "returns a DefraRubyEmail::Configuration instance with default values" do
        expect(described_class.configuration).to be_an_instance_of(DefraRubyEmail::Configuration)

        expect(described_class.configuration.enabled?).to eq(enabled)
      end
    end

    context "when the host app has provided configuration" do
      let(:enabled) { true }

      it "returns a DefraRubyEmail::Configuration instance with matching values" do
        described_class.configure do |config|
          config.enable = enabled
        end

        expect(described_class.configuration).to be_an_instance_of(DefraRubyEmail::Configuration)
        expect(described_class.configuration.enabled?).to eq(enabled)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
defra_ruby_email-1.2.0 spec/defra_ruby_email_spec.rb
defra_ruby_email-1.1.0 spec/defra_ruby_email_spec.rb
defra_ruby_email-1.0.0 spec/defra_ruby_email_spec.rb
defra_ruby_email-0.2.0 spec/defra_ruby_email_spec.rb
defra_ruby_email-0.1.0 spec/defra_ruby_email_spec.rb