From e9abbe12fbedeb8345f413dff3ab1aadbe860ef4 Mon Sep 17 00:00:00 2001 From: John Mettraux Date: Wed, 12 Nov 2008 22:08:45 +0900 Subject: [PATCH] separated version in its own file and added first tests --- lib/rufus/gversion.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ test/t_0_cal.rb | 31 +++++++++++++++++++++++++++++++ test/test.rb | 3 +++ 3 files changed, 76 insertions(+) create mode 100644 lib/rufus/gversion.rb create mode 100644 test/t_0_cal.rb create mode 100644 test/test.rb diff --git a/lib/rufus/gversion.rb b/lib/rufus/gversion.rb new file mode 100644 index 0000000..80b37bf --- /dev/null +++ b/lib/rufus/gversion.rb @@ -0,0 +1,42 @@ +# +#-- +# Copyright (c) 2008, John Mettraux, jmettraux@gmail.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# (MIT license) +#++ +# + +# +# John Mettraux +# +# Made in Japan +# +# Wed Nov 12 20:08:24 JST 2008 +# + +module Rufus +module Google + + VERSION = '0.0.1' + +end +end + diff --git a/test/t_0_cal.rb b/test/t_0_cal.rb new file mode 100644 index 0000000..6c95338 --- /dev/null +++ b/test/t_0_cal.rb @@ -0,0 +1,31 @@ + +# +# Testing rufus-google +# +# Wed Nov 12 20:59:36 JST 2008 +# + +require 'test/unit' +require 'rubygems' +require 'rufus/gcal' + +class Test0Cal < Test::Unit::TestCase + + def test_0 + + calendars = Rufus::Google::Calendar.get_calendars( + :account => ENV['GUSER'], :password => ENV['GPASS']) + + cal = calendars['gwork'] + + event_id = cal.post_quick!('Tennis with Zorglub November 13 3pm-4:30pm') + + assert_equal 1, cal.events(:q => 'zorglub').size + + cal.delete!(event_id) + + assert_equal [], cal.events(:q => 'zorglub') + end + +end + diff --git a/test/test.rb b/test/test.rb new file mode 100644 index 0000000..83fc080 --- /dev/null +++ b/test/test.rb @@ -0,0 +1,3 @@ + +require 't_0_cal.rb' +