at-random 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/at-random/at_cmd.rb +2 -2
- data/lib/at-random/pick_time.rb +1 -1
- data/lib/at-random/version.rb +1 -1
- data/spec/at-random/at_cmd_spec.rb +5 -5
- metadata +1 -1
data/lib/at-random/at_cmd.rb
CHANGED
@@ -13,12 +13,12 @@ module AtRandom
|
|
13
13
|
raise InvalidTime, "Timespec #{timespec} is earlier than now"
|
14
14
|
end
|
15
15
|
|
16
|
-
@exec_args = ['at',
|
16
|
+
@exec_args = ['at', args, timespec].flatten
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def exec
|
21
|
-
|
21
|
+
Kernel.exec(*@exec_args)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/at-random/pick_time.rb
CHANGED
data/lib/at-random/version.rb
CHANGED
@@ -6,7 +6,7 @@ describe AtRandom::AtCmd do
|
|
6
6
|
let!(:frozen_now) { Time.local(2015, 05, 25) }
|
7
7
|
before do
|
8
8
|
Time.stubs(:now).returns(frozen_now)
|
9
|
-
|
9
|
+
Kernel.stubs(:exec)
|
10
10
|
end
|
11
11
|
|
12
12
|
let(:timespec) { '12:30' }
|
@@ -61,7 +61,7 @@ describe AtRandom::AtCmd do
|
|
61
61
|
subject { at_with_args.exec }
|
62
62
|
|
63
63
|
it 'execs `at`' do
|
64
|
-
|
64
|
+
Kernel.expects(:exec).with('at', any_parameters)
|
65
65
|
subject
|
66
66
|
end
|
67
67
|
|
@@ -69,14 +69,14 @@ describe AtRandom::AtCmd do
|
|
69
69
|
let(:at_args) { ['-f', 'foo'] }
|
70
70
|
|
71
71
|
it 'passes arguments to `at`' do
|
72
|
-
|
72
|
+
Kernel.expects(:exec).with('at', '-f', 'foo', anything)
|
73
73
|
subject
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
describe '`at` timespec' do
|
78
|
-
it 'is the
|
79
|
-
|
78
|
+
it 'is the last argument to AtCmd.new' do
|
79
|
+
Kernel.expects(:exec).with('at', timespec)
|
80
80
|
subject
|
81
81
|
end
|
82
82
|
end
|