Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 255879e510cd2730ef878a64ae2c57f3d7528d10 Matthew committed Dec 4, 2009
Showing with 119 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +20 −0 MIT-LICENSE
  3. +32 −0 README
  4. +18 −0 Rakefile
  5. +1 −0 VERSION
  6. +13 −0 lib/time_zone_warp.rb
  7. +34 −0 time-zone-warp.gemspec
@@ -0,0 +1 @@
+pkg
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Adeptware, Inc.
+
+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.
@@ -0,0 +1,32 @@
+time-zone-warp
+=========
+
+If time zone support is critical to your app, it's often necessary to test
+various methods as if they were being run in a specific time zone.
+
+
+Installation
+============
+
+Gem:
+
+$ sudo gem install time-zone-warp
+
+Gem config in a Rails app. Add to environment.rb:
+
+config.gem 'time-zone-warp'
+
+
+Example
+=======
+
+ class UserTest < Test::Unit::TestCase
+ test "code works in other time zones" do
+ pretend_zone_is "Mountain Time (US & Canada)" do
+ # assertions go here
+ end
+ end
+ end
+
+
+Copyright (c) 2009 Adeptware, Inc. Released under the MIT license.
@@ -0,0 +1,18 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "time-zone-warp"
+ gemspec.summary = "Warp time zones in your tests."
+ gemspec.description = "Warp time zones in your tests."
+ gemspec.email = "contact@adeptware.com"
+ gemspec.homepage = "http://github.com/adeptware/time-zone-warp"
+ gemspec.authors = ["Adeptware"]
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+end
+
+Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1 @@
+1.0.0
@@ -0,0 +1,13 @@
+module TimeZoneWarp
+ def pretend_zone_is(zone)
+ original_zone = Time.zone
+ begin
+ Time.zone = zone
+ yield
+ ensure
+ Time.zone = original_zone
+ end
+ end
+end
+
+Test::Unit::TestCase.send(:include, TimeZoneWarp)
@@ -0,0 +1,34 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{time-zone-warp}
+ s.version = "1.0.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Adeptware"]
+ s.date = %q{2009-12-03}
+ s.description = %q{Warp time zones in your tests.}
+ s.email = %q{contact@adeptware.com}
+ s.extra_rdoc_files = [
+ "README"
+ ]
+ s.homepage = %q{http://github.com/adeptware/time-zone-warp}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{Warp time zones in your tests.}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
+

0 comments on commit 255879e

Please sign in to comment.