cucumber-timecop 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e8af8fb32975cfb922867084dc7e0439fd3028e
4
- data.tar.gz: 2733a1143835da89fb80ba9353befb6ac60533ad
3
+ metadata.gz: 51233a07fe90931cd8ebd4bf1dc7d686b5f2f941
4
+ data.tar.gz: 8e20aec9270c54517a8e908cb26c53b25009ac7d
5
5
  SHA512:
6
- metadata.gz: 8afa09033e510838e0137c58d25c089aa11940cddc62e9151b2bb9a675a765ab1781980084d8ecd752327aeaf1110a4b9271c985129a9266da4415163a7cd745
7
- data.tar.gz: 39bb727bba2c6cb42b5bd17cc6a1d003a175f963951bc0fdcd37c6616fd2861e2fca111ec46d88cfef72174c8bafed9bcbb98f62ae3bb2991fb1ea19f57a0ab0
6
+ metadata.gz: b809e9fb9abd8df23c4698b536df12f39eb016edc7392e36799a0f60b57a01b5f86dee0ca09e4b065d165333342306f84a9d20117d2a195cc8e4efbd3b008052
7
+ data.tar.gz: 8638bb13a5ea67838eb49e91506f604e6cb7ab49079e194de41c5e7b16b15d0cc7af850a6b81b292eec80a7b37dc77406e9993f64e45b1c6e06ffee4c9f2ff69
data/Rakefile CHANGED
@@ -1 +1 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
@@ -4,25 +4,27 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'cucumber/timecop/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "cucumber-timecop"
7
+ spec.name = 'cucumber-timecop'
8
8
  spec.version = Cucumber::Timecop::VERSION
9
- spec.authors = ["zedtux"]
10
- spec.email = ["zedtux@zedroot.org"]
11
- spec.description = %q{Timecop steps definition for Cucumber}
12
- spec.summary = %q{Add this gem to the test group of you Gemfile in order to be able to travel in time in you Cucumber scenarios.}
13
- spec.homepage = "https://github.com/zedtux/cucumber-timecop"
14
- spec.license = "MIT"
9
+ spec.authors = ['zedtux']
10
+ spec.email = ['zedtux@zedroot.org']
11
+ spec.description = 'Timecop steps definition for Cucumber'
12
+ spec.summary = 'Add this gem to the test group of you Gemfile ' \
13
+ 'in order to be able to travel in time ' \
14
+ 'in you Cucumber scenarios.'
15
+ spec.homepage = 'https://github.com/zedtux/cucumber-timecop'
16
+ spec.license = 'MIT'
15
17
 
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
18
+ spec.files = `git ls-files`.split($RS)
19
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(/^(test|spec|features)/)
21
+ spec.require_paths = ['lib']
20
22
 
21
- spec.add_dependency "cucumber"
22
- spec.add_dependency "timecop"
23
- spec.add_dependency "chronic"
23
+ spec.add_dependency 'cucumber'
24
+ spec.add_dependency 'timecop'
25
+ spec.add_dependency 'chronic'
24
26
 
25
- spec.add_development_dependency "bundler", "~> 1.3"
26
- spec.add_development_dependency "rake"
27
+ spec.add_development_dependency 'bundler', '~> 1.3'
28
+ spec.add_development_dependency 'rake'
27
29
 
28
30
  end
@@ -1,8 +1,13 @@
1
- require "chronic"
2
- require "timecop"
3
-
1
+ require 'chronic'
2
+ require 'timecop'
3
+
4
+ #
5
+ # TemporalHelpers module group all the needed methods to use Timecop with
6
+ # Cucumber
7
+ #
8
+ # @author [zedtux]
9
+ #
4
10
  module TemporalHelpers
5
-
6
11
  # Travels to +time+ and lets the clock keep running.
7
12
  #
8
13
  # If a block is given, executes the block at that
@@ -24,26 +29,25 @@ module TemporalHelpers
24
29
  def parse_time(time)
25
30
  Chronic.parse(time) || Time.parse(time)
26
31
  end
27
-
28
32
  end
29
33
 
30
34
  World(TemporalHelpers)
31
35
 
32
- Given /^it is currently (.+)$/ do |time|
36
+ Given(/^it is currently (.+)$/) do |time|
33
37
  travel_to time
34
38
  end
35
39
 
36
- Given /^time is frozen at (.+)$/ do |time|
40
+ Given(/^time is frozen at (.+)$/) do |time|
37
41
  freeze_time_at time
38
42
  end
39
43
 
40
- Given /^(?:I|we) jump in our Delorean and return to the present$/ do
44
+ Given(/^(?:I|we) jump in our Delorean and return to the present$/) do
41
45
  Timecop.return
42
46
  end
43
47
 
44
48
  Before do
45
49
  # Ensure Chronic is using the same time zone
46
- Chronic.time_class = Time.now.zone
50
+ Chronic.time_class = defined?(Rails) ? Time.zone : Time.now.zone
47
51
  end
48
52
 
49
53
  After do
@@ -1,5 +1,10 @@
1
1
  module Cucumber
2
+ #
3
+ # Cucumber::Timecop::VERSION used to manage the gem version
4
+ #
5
+ # @author [zedtux]
6
+ #
2
7
  module Timecop
3
- VERSION = "0.0.4"
8
+ VERSION = '0.0.5'
4
9
  end
5
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-timecop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - zedtux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber