tins 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tins/date_dummy.rb +2 -0
- data/lib/tins/date_time_dummy.rb +2 -0
- data/lib/tins/time_dummy.rb +2 -0
- data/lib/tins/version.rb +1 -1
- data/tests/time_freezer_test.rb +34 -4
- data/tins.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66237f324e3dec090fb0fe7cf5352ea4c33f6068
|
4
|
+
data.tar.gz: c2178480d9cbc13af1f7f21be6bdba36ca100c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ad455233919fc4a79c67e0a56fa7f809d872e2953653e1a0475cf502746e3a7d94f5dbbda3f647e418da884d554194ea66c20747698ba46f535af1f14677063
|
7
|
+
data.tar.gz: f26f33ebe4d32dbe1437b91753fe9980d56e52bb1064a650ce61f33bddcee4971e214b2fbc4afa61baa58addaf2eef2513dc2100d5188690c36847b81da0aac2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.3
|
data/lib/tins/date_dummy.rb
CHANGED
data/lib/tins/date_time_dummy.rb
CHANGED
data/lib/tins/time_dummy.rb
CHANGED
data/lib/tins/version.rb
CHANGED
data/tests/time_freezer_test.rb
CHANGED
@@ -4,11 +4,41 @@ require 'tins'
|
|
4
4
|
module Tins
|
5
5
|
class TimeFreezerTest < Test::Unit::TestCase
|
6
6
|
def test_freezing
|
7
|
-
freezing_point = '2011-11-11T11:11:
|
7
|
+
freezing_point = '2011-11-11T11:11:11Z'
|
8
8
|
Tins::TimeFreezer.freeze(freezing_point) do
|
9
|
-
assert_equal
|
10
|
-
assert_equal
|
11
|
-
assert_equal
|
9
|
+
assert_equal "2011-11-11 11:11:11 UTC", Time.now.to_s
|
10
|
+
assert_equal "2011-11-11T11:11:11+00:00", DateTime.now.to_s
|
11
|
+
assert_equal "2011-11-11", Date.today.to_s
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_to_time_conversion
|
16
|
+
freezing_point = '2011-11-11T11:11:11Z'
|
17
|
+
time = Time.parse(freezing_point)
|
18
|
+
Tins::TimeFreezer.freeze(time) do
|
19
|
+
assert_equal "2011-11-11 11:11:11 UTC", Time.now.utc.to_s
|
20
|
+
assert_equal "2011-11-11T11:11:11+00:00", DateTime.now.to_s
|
21
|
+
assert_equal "2011-11-11", Date.today.to_s
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_to_date_conversion
|
26
|
+
freezing_point = '2011-11-11Z'
|
27
|
+
date = Date.parse(freezing_point)
|
28
|
+
Tins::TimeFreezer.freeze(date) do
|
29
|
+
assert_equal "2011-11", Time.now.utc.to_s[0, 7]
|
30
|
+
assert_equal "2011-11", DateTime.now.to_s[0, 7]
|
31
|
+
assert_equal "2011-11", Date.today.to_s[0, 7]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_to_datetime_conversion
|
36
|
+
freezing_point = '2011-11-11T11:11:11Z'
|
37
|
+
datetime = DateTime.parse(freezing_point)
|
38
|
+
Tins::TimeFreezer.freeze(datetime) do
|
39
|
+
assert_equal "2011-11-11 11:11:11 UTC", Time.now.utc.to_s
|
40
|
+
assert_equal "2011-11-11T11:11:11+00:00", DateTime.now.to_s
|
41
|
+
assert_equal "2011-11-11", Date.today.to_s
|
12
42
|
end
|
13
43
|
end
|
14
44
|
end
|
data/tins.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: tins 1.3.
|
2
|
+
# stub: tins 1.3.3 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "tins"
|
6
|
-
s.version = "1.3.
|
6
|
+
s.version = "1.3.3"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Florian Frank"]
|
11
|
-
s.date = "2014-
|
11
|
+
s.date = "2014-09-18"
|
12
12
|
s.description = "All the stuff that isn't good/big enough for a real library."
|
13
13
|
s.email = "flori@ping.de"
|
14
14
|
s.extra_rdoc_files = ["README.md", "lib/dslkit.rb", "lib/dslkit/polite.rb", "lib/dslkit/rude.rb", "lib/spruz.rb", "lib/tins.rb", "lib/tins/alias.rb", "lib/tins/annotate.rb", "lib/tins/ask_and_send.rb", "lib/tins/attempt.rb", "lib/tins/bijection.rb", "lib/tins/case_predicate.rb", "lib/tins/concern.rb", "lib/tins/count_by.rb", "lib/tins/date_dummy.rb", "lib/tins/date_time_dummy.rb", "lib/tins/deep_const_get.rb", "lib/tins/deep_dup.rb", "lib/tins/dslkit.rb", "lib/tins/extract_last_argument_options.rb", "lib/tins/file_binary.rb", "lib/tins/find.rb", "lib/tins/generator.rb", "lib/tins/go.rb", "lib/tins/hash_symbolize_keys_recursive.rb", "lib/tins/hash_union.rb", "lib/tins/if_predicate.rb", "lib/tins/limited.rb", "lib/tins/lines_file.rb", "lib/tins/memoize.rb", "lib/tins/method_description.rb", "lib/tins/minimize.rb", "lib/tins/module_group.rb", "lib/tins/named_set.rb", "lib/tins/null.rb", "lib/tins/once.rb", "lib/tins/p.rb", "lib/tins/partial_application.rb", "lib/tins/proc_compose.rb", "lib/tins/proc_prelude.rb", "lib/tins/range_plus.rb", "lib/tins/require_maybe.rb", "lib/tins/responding.rb", "lib/tins/rotate.rb", "lib/tins/secure_write.rb", "lib/tins/sexy_singleton.rb", "lib/tins/shuffle.rb", "lib/tins/string_byte_order_mark.rb", "lib/tins/string_camelize.rb", "lib/tins/string_underscore.rb", "lib/tins/string_version.rb", "lib/tins/subhash.rb", "lib/tins/terminal.rb", "lib/tins/thread_local.rb", "lib/tins/time_dummy.rb", "lib/tins/to.rb", "lib/tins/to_proc.rb", "lib/tins/token.rb", "lib/tins/uniq_by.rb", "lib/tins/version.rb", "lib/tins/write.rb", "lib/tins/xt.rb", "lib/tins/xt/annotate.rb", "lib/tins/xt/ask_and_send.rb", "lib/tins/xt/attempt.rb", "lib/tins/xt/blank.rb", "lib/tins/xt/case_predicate.rb", "lib/tins/xt/concern.rb", "lib/tins/xt/count_by.rb", "lib/tins/xt/date_dummy.rb", "lib/tins/xt/date_time_dummy.rb", "lib/tins/xt/deep_const_get.rb", "lib/tins/xt/deep_dup.rb", "lib/tins/xt/dslkit.rb", "lib/tins/xt/extract_last_argument_options.rb", "lib/tins/xt/file_binary.rb", "lib/tins/xt/full.rb", "lib/tins/xt/hash_symbolize_keys_recursive.rb", "lib/tins/xt/hash_union.rb", "lib/tins/xt/if_predicate.rb", "lib/tins/xt/irb.rb", "lib/tins/xt/method_description.rb", "lib/tins/xt/named.rb", "lib/tins/xt/null.rb", "lib/tins/xt/p.rb", "lib/tins/xt/partial_application.rb", "lib/tins/xt/proc_compose.rb", "lib/tins/xt/proc_prelude.rb", "lib/tins/xt/range_plus.rb", "lib/tins/xt/require_maybe.rb", "lib/tins/xt/responding.rb", "lib/tins/xt/rotate.rb", "lib/tins/xt/secure_write.rb", "lib/tins/xt/sexy_singleton.rb", "lib/tins/xt/shuffle.rb", "lib/tins/xt/string.rb", "lib/tins/xt/string_byte_order_mark.rb", "lib/tins/xt/string_camelize.rb", "lib/tins/xt/string_underscore.rb", "lib/tins/xt/string_version.rb", "lib/tins/xt/subhash.rb", "lib/tins/xt/symbol_to_proc.rb", "lib/tins/xt/time_dummy.rb", "lib/tins/xt/time_freezer.rb", "lib/tins/xt/to.rb", "lib/tins/xt/uniq_by.rb", "lib/tins/xt/write.rb"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|