Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Stride#configuration will return a non nil object #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/stride.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@

module Stride
class << self
attr_accessor :configuration
attr_writer :configuration

def configuration
@configuration ||= Configuration.new
end
end

def self.configure
self.configuration ||= Configuration.new
yield(configuration)
end
end
8 changes: 8 additions & 0 deletions spec/stride_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
require 'spec_helper'

RSpec.describe Stride do
describe '.configuration' do
it 'returns a non nil object' do
described_class.configuration = nil

expect(described_class.configuration).to_not be nil
end
end

describe '.configure' do
before do
described_class.configure do |config|
Expand Down