time-zone-warp 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ pkg
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Adeptware, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,32 @@
1
+ time-zone-warp
2
+ =========
3
+
4
+ If time zone support is critical to your app, it's often necessary to test
5
+ various methods as if they were being run in a specific time zone.
6
+
7
+
8
+ Installation
9
+ ============
10
+
11
+ Gem:
12
+
13
+ $ sudo gem install time-zone-warp
14
+
15
+ Gem config in a Rails app. Add to test.rb:
16
+
17
+ config.gem 'time-zone-warp', :lib => 'time_zone_warp'
18
+
19
+
20
+ Example
21
+ =======
22
+
23
+ class UserTest < Test::Unit::TestCase
24
+ test "code works in other time zones" do
25
+ pretend_zone_is "Mountain Time (US & Canada)" do
26
+ # assertions go here
27
+ end
28
+ end
29
+ end
30
+
31
+
32
+ Copyright (c) 2009 Adeptware, Inc. Released under the MIT license.
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gemspec|
7
+ gemspec.name = "time-zone-warp"
8
+ gemspec.summary = "Warp time zones in your tests."
9
+ gemspec.description = "Warp time zones in your tests."
10
+ gemspec.email = "contact@adeptware.com"
11
+ gemspec.homepage = "http://github.com/adeptware/time-zone-warp"
12
+ gemspec.authors = ["Adeptware"]
13
+ end
14
+ rescue LoadError
15
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
16
+ end
17
+
18
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,15 @@
1
+ require 'test/unit'
2
+
3
+ module TimeZoneWarp
4
+ def pretend_zone_is(zone)
5
+ original_zone = Time.zone
6
+ begin
7
+ Time.zone = zone
8
+ yield
9
+ ensure
10
+ Time.zone = original_zone
11
+ end
12
+ end
13
+ end
14
+
15
+ Test::Unit::TestCase.send(:include, TimeZoneWarp)
@@ -0,0 +1,43 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{time-zone-warp}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Adeptware"]
12
+ s.date = %q{2009-12-03}
13
+ s.description = %q{Warp time zones in your tests.}
14
+ s.email = %q{contact@adeptware.com}
15
+ s.extra_rdoc_files = [
16
+ "README"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "MIT-LICENSE",
21
+ "README",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "lib/time_zone_warp.rb",
25
+ "time-zone-warp.gemspec"
26
+ ]
27
+ s.homepage = %q{http://github.com/adeptware/time-zone-warp}
28
+ s.rdoc_options = ["--charset=UTF-8"]
29
+ s.require_paths = ["lib"]
30
+ s.rubygems_version = %q{1.3.5}
31
+ s.summary = %q{Warp time zones in your tests.}
32
+
33
+ if s.respond_to? :specification_version then
34
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
35
+ s.specification_version = 3
36
+
37
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
38
+ else
39
+ end
40
+ else
41
+ end
42
+ end
43
+
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: time-zone-warp
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Adeptware
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-03 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Warp time zones in your tests.
17
+ email: contact@adeptware.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ files:
25
+ - .gitignore
26
+ - MIT-LICENSE
27
+ - README
28
+ - Rakefile
29
+ - VERSION
30
+ - lib/time_zone_warp.rb
31
+ - time-zone-warp.gemspec
32
+ has_rdoc: true
33
+ homepage: http://github.com/adeptware/time-zone-warp
34
+ licenses: []
35
+
36
+ post_install_message:
37
+ rdoc_options:
38
+ - --charset=UTF-8
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ version:
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ requirements: []
54
+
55
+ rubyforge_project:
56
+ rubygems_version: 1.3.5
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Warp time zones in your tests.
60
+ test_files: []
61
+