timeliness 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ = 0.3.2 - 2010-11-26
2
+ * Catch all errors for ActiveSupport not being loaded for more helpful error
3
+
1
4
  = 0.3.1 - 2010-11-27
2
5
  * Fix issue with 2nd argument options being overidden
3
6
 
@@ -16,8 +16,8 @@ module Timeliness
16
16
 
17
17
  make_time(time_array[0..7], options[:zone])
18
18
  rescue NoMethodError => ex
19
- raise ex unless ex.message =~ /zone/
20
- raise MissingTimezoneSupport, "ActiveSupport must be loaded to use timezones other than :utc and :local."
19
+ raise ex unless ex.message =~ /undefined method `(zone|use_zone|current)' for Time:Class/
20
+ raise MissingTimezoneSupport, "ActiveSupport timezone support must be loaded to use timezones other than :utc and :local."
21
21
  end
22
22
 
23
23
  def make_time(time_array, zone_option=nil)
@@ -1,3 +1,3 @@
1
1
  module Timeliness
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -164,9 +164,19 @@ describe Timeliness::Parser do
164
164
 
165
165
  context "without ActiveSupport loaded" do
166
166
  it 'should output message' do
167
- lambda {
167
+ expect {
168
168
  Time.should_receive(:zone).and_raise(NoMethodError.new("undefined method `zone' for Time:Class"))
169
- time = parse("2000-06-01 12:13:14", :datetime, :zone => :current)
169
+ parse("2000-06-01 12:13:14", :zone => :current)
170
+ }.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
171
+
172
+ expect {
173
+ Time.should_receive(:current).and_raise(NoMethodError.new("undefined method `current' for Time:Class"))
174
+ parse("12:13:14", :zone => :current)
175
+ }.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
176
+
177
+ expect {
178
+ Time.should_receive(:use_zone).and_raise(NoMethodError.new("undefined method `use_zone' for Time:Class"))
179
+ parse("2000-06-01 12:13:14", :zone => 'London')
170
180
  }.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
171
181
  end
172
182
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeliness
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Meehan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-27 00:00:00 +11:00
18
+ date: 2010-11-28 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies: []
21
21