Sha256: e8dad9445228961f654b012a2c4afbc2cba76a239d1820b841830763fb4f760e

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

module Almanack
  describe Configuration do

    describe "#add_events" do
      it "adds a simple event collection event source" do
        config = Configuration.new
        expect(config.event_sources.size).to eq(0)

        config.add_events [
          { title: "Hogswatch" }
        ]

        expect(config.event_sources.size).to eq(1)
        expect(config.event_sources.first).to be_an_instance_of(SimpleEventCollection)
      end
    end

    describe "#ical_feed" do
      it "adds an iCal feed event source" do
        config = Configuration.new
        expect(config.event_sources.size).to eq(0)

        config.add_ical_feed "https://www.google.com/calendar/ical/61s2re9bfk01abmla4d17tojuo%40group.calendar.google.com/public/basic.ics"
        
        expect(config.event_sources.size).to eq(1)
        expect(config.event_sources.first).to be_an_instance_of(IcalFeed)
      end
    end

    describe "#meetup_group" do
      it "adds a Meetup group event source" do
        config = Configuration.new
        expect(config.event_sources.size).to eq(0)

        config.add_meetup_group(group_urlname: "CHC-JS", key: "secrettoken")
        
        expect(config.event_sources.size).to eq(1)
        expect(config.event_sources.first).to be_an_instance_of(MeetupGroup)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
almanack-0.0.1.alpha2 spec/configuration_spec.rb
almanack-0.0.1.alpha1 spec/configuration_spec.rb