Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
getfitter-core / spec / core / configuration_spec.rb
Size: Mime:
require 'rails_helper'

RSpec.describe Core::Configuration do
  let(:config) { described_class.new stripe_token: 'a', opencage_token: 'b' }

  it 'has a full set of configured values' do
    expect(config.stripe_token).to eq 'a'
    expect(config.opencage_token).to eq 'b'
  end

  it 'has a string representation' do
    expect(config.to_s).to be_a String
    # looks for a pattern that looks like:
    #   #<Core::Configuration:70239258795920 stripe_token=a>
    #   #<Core::Configuration:70239258795920>
    expect(config.to_s).to match(/#<[a-zA-Z]*::[a-zA-Z]*:[0-9]*\
(?=>?|\s[a-z_=]*\s?[a-z_=]*>)/)
  end

  it 'has a hash representation' do
    hash = config.to_h

    expect(hash).to be_a Hash
    expect(hash[:stripe_token]).to eq 'a'
  end
end