whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [15/50] Commit 9b2b090: add parsing unit test
Date Fri, 22 Jan 2016 02:40:53 GMT
Commit 9b2b09080d8f27f9aa8bbfa60677b584a33dcadd:
    add parsing unit test


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
spec/parse_spec.rb                                           | ++++++++ 
------------------------------------------------------------
32 changes: 32 additions, 0 deletions.
------------------------------------------------------------


diff --git a/spec/parse_spec.rb b/spec/parse_spec.rb
new file mode 100644
index 0000000..7bc27fd
--- /dev/null
+++ b/spec/parse_spec.rb
@@ -0,0 +1,32 @@
+#
+# Agenda parsing
+#
+
+require_relative 'spec_helper'
+
+feature 'parse' do
+  it "should parse an agenda file" do
+    parsed = Dir.chdir FOUNDATION_BOARD do
+      AGENDA_CACHE.parse('board_agenda_2015_02_18.txt', true)[:parsed]
+    end
+
+    abdera = parsed.find {|item| item['title'] == 'Abdera'}
+    expect(abdera[:attach]).to eq("A")
+    expect(abdera['owner']).to eq('Ant Elder')
+    expect(abdera['missing']).to equal(true)
+    expect(abdera['comments']).to eq('rb: Reminder email sent')
+    expect(abdera['shepherd']).to eq('Rich')
+    expect(abdera[:index]).to eq("Committee Reports")
+
+    aries = parsed.find {|item| item['title'] == 'Aries'}
+    expect(aries[:attach]).to eq("G")
+    expect(aries['owner']).to eq('Jeremy Hughes')
+    expect(aries['missing']).to equal(nil)
+    expect(aries['comments']).to eq('')
+    expect(aries['shepherd']).to eq('Jim')
+    expect(aries['approved']).to include('sr')
+
+    actions = parsed.find {|item| item['title'] == 'Action Items'}
+    expect(actions['actions']['Rave']).to include(/Sam:/)
+  end
+end

Mime
View raw message