almanack 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +12 -17
- data/.rspec +3 -0
- data/.travis.yml +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +123 -0
- data/LICENSE.txt +17 -18
- data/README.md +22 -4
- data/Rakefile +16 -0
- data/almanack.gemspec +18 -8
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/test +2 -0
- data/certs/aupajo.pem +25 -0
- data/{bin → exe}/almanack +0 -0
- data/lib/almanack/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +62 -59
- metadata.gz.sig +3 -0
- data/spec/almanack_spec.rb +0 -8
- data/spec/calendar_spec.rb +0 -71
- data/spec/configuration_spec.rb +0 -113
- data/spec/event_source/ical_feed_spec.rb +0 -40
- data/spec/event_source/meetup_group_spec.rb +0 -63
- data/spec/event_source/static_spec.rb +0 -41
- data/spec/event_spec.rb +0 -121
- data/spec/features/api_feature_spec.rb +0 -24
- data/spec/features/calendar_feature_spec.rb +0 -44
- data/spec/features/sass_features_spec.rb +0 -15
- data/spec/features/subscription_feature_spec.rb +0 -60
- data/spec/fixtures/responses/google_calendar.yml +0 -1896
- data/spec/fixtures/responses/meetup-without-location.yml +0 -11880
- data/spec/fixtures/responses/meetup.yml +0 -1437
- data/spec/fixtures/themes/sassy/stylesheets/imported.scss +0 -0
- data/spec/fixtures/themes/sassy/stylesheets/imports.scss +0 -1
- data/spec/representation/json_feed_spec.rb +0 -44
- data/spec/serialized_transformation_spec.rb +0 -45
- data/spec/spec_helper.rb +0 -21
- data/spec/support/event_matchers.rb +0 -54
- data/spec/support/server_support.rb +0 -10
- data/spec/support/time_comparison_matchers.rb +0 -14
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
@import 'imported';
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Almanack::Representation
|
4
|
-
describe JSONFeed do
|
5
|
-
|
6
|
-
let(:calendar) { Almanack.calendar }
|
7
|
-
let(:parsed_json) { JSON.parse JSONFeed.from(calendar).to_s }
|
8
|
-
|
9
|
-
before do
|
10
|
-
Almanack.reset!
|
11
|
-
end
|
12
|
-
|
13
|
-
describe ".from" do
|
14
|
-
around do |test|
|
15
|
-
Timecop.freeze(Time.now, &test)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "returns empty event sources by default" do
|
19
|
-
expect(parsed_json).to eq({ "eventSources" => [] })
|
20
|
-
end
|
21
|
-
|
22
|
-
it "returns event sources" do
|
23
|
-
Almanack.config.add_events [
|
24
|
-
{ title: "Basic event", start_time: Time.now, custom_data: 'present' }
|
25
|
-
]
|
26
|
-
|
27
|
-
expect(parsed_json).to eq({
|
28
|
-
"eventSources" => [
|
29
|
-
{
|
30
|
-
"events" => [
|
31
|
-
{
|
32
|
-
"title" => "Basic event",
|
33
|
-
"startTime" => Time.now.iso8601,
|
34
|
-
"customData" => 'present'
|
35
|
-
}
|
36
|
-
]
|
37
|
-
}
|
38
|
-
]
|
39
|
-
})
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Almanack
|
4
|
-
describe SerializedTransformation do
|
5
|
-
let(:fact_book) do
|
6
|
-
{
|
7
|
-
title: "Facts of the World",
|
8
|
-
countries: [
|
9
|
-
{ name: "New Zealand", population: "4 mil" },
|
10
|
-
{ name: "America", population: "320 mil" }
|
11
|
-
]
|
12
|
-
}
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:transformation) { described_class.new(fact_book) }
|
16
|
-
|
17
|
-
describe "#apply" do
|
18
|
-
it "returns an unmodified structure by default" do
|
19
|
-
expect(transformation.apply).to eq fact_book
|
20
|
-
end
|
21
|
-
|
22
|
-
it "can apply changes to keys" do
|
23
|
-
transformation.key { |key| key.to_s }
|
24
|
-
expect(transformation.apply).to eq({
|
25
|
-
"title" => "Facts of the World",
|
26
|
-
"countries" => [
|
27
|
-
{ "name" => "New Zealand", "population" => "4 mil" },
|
28
|
-
{ "name" => "America", "population" => "320 mil" }
|
29
|
-
]
|
30
|
-
})
|
31
|
-
end
|
32
|
-
|
33
|
-
it "can apply changes to values" do
|
34
|
-
transformation.value { |value| value.upcase }
|
35
|
-
expect(transformation.apply).to eq({
|
36
|
-
title: "FACTS OF THE WORLD",
|
37
|
-
countries: [
|
38
|
-
{ name: "NEW ZEALAND", population: "4 MIL" },
|
39
|
-
{ name: "AMERICA", population: "320 MIL" }
|
40
|
-
]
|
41
|
-
})
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'webmock/rspec'
|
2
|
-
require 'vcr'
|
3
|
-
require 'timecop'
|
4
|
-
require 'nokogiri'
|
5
|
-
|
6
|
-
require 'almanack'
|
7
|
-
|
8
|
-
Dir[File.expand_path('../support/*.rb', __FILE__)].each { |file| require file }
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
config.include ServerSupport, :feature
|
12
|
-
config.include EventMatchers
|
13
|
-
config.include TimeComparisonMatchers
|
14
|
-
end
|
15
|
-
|
16
|
-
VCR.configure do |config|
|
17
|
-
config.cassette_library_dir = File.expand_path('../fixtures/responses', __FILE__)
|
18
|
-
config.hook_into :webmock
|
19
|
-
end
|
20
|
-
|
21
|
-
WebMock.disable_net_connect!
|
@@ -1,54 +0,0 @@
|
|
1
|
-
module EventMatchers
|
2
|
-
extend RSpec::Matchers::DSL
|
3
|
-
|
4
|
-
matcher :have_event do |title = nil, attrs = {}|
|
5
|
-
match do |events|
|
6
|
-
attrs[:title] = title if title
|
7
|
-
|
8
|
-
events.any? do |event|
|
9
|
-
attrs.all? { |k,v| event.send(k) == v }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
failure_message do |events|
|
14
|
-
"expected to see an event with #{attrs.inspect}, saw #{events.inspect}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
matcher :all_have_properties do |*properties|
|
19
|
-
match do |collection|
|
20
|
-
collection.all? do |obj|
|
21
|
-
properties.all? { |p| !obj.send(p).nil? }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
failure_message do |events|
|
26
|
-
"expected to all events to have properites #{properties.inspect}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
matcher :be_in_order do
|
31
|
-
match do |events|
|
32
|
-
events == events.sort_by(&:start_time)
|
33
|
-
end
|
34
|
-
|
35
|
-
failure_message do |events|
|
36
|
-
"expected to events to be in order"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
matcher :have_event_on_page do |title|
|
41
|
-
match do |response|
|
42
|
-
raise response.errors if !response.errors.empty?
|
43
|
-
|
44
|
-
doc = Nokogiri::HTML(response.body)
|
45
|
-
|
46
|
-
@titles = doc.css('.event .title').map { |e| e.text.strip }
|
47
|
-
@titles.any? { |t| t == title.strip }
|
48
|
-
end
|
49
|
-
|
50
|
-
failure_message do |response|
|
51
|
-
"expected to see an event named #{title.inspect}, got #@titles"
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module TimeComparisonMatchers
|
2
|
-
extend RSpec::Matchers::DSL
|
3
|
-
|
4
|
-
matcher :eq_time do |expected_time|
|
5
|
-
match do |actual_time|
|
6
|
-
actual_time.to_time.to_i == expected_time.to_time.to_i
|
7
|
-
end
|
8
|
-
|
9
|
-
failure_message do |actual_time|
|
10
|
-
"expected #{actual_time.to_time} to be equal in time to #{expected_time.to_time}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|