rivendell-import 0.0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ require 'rivendell/import/cli'
5
5
  describe Rivendell::Import::CLI do
6
6
 
7
7
  describe "#config_file" do
8
-
8
+
9
9
  it "should return file specified with --config" do
10
10
  subject.arguments << "--config" << "dummy"
11
11
  subject.config_file.should == "dummy"
@@ -19,11 +19,11 @@ describe Rivendell::Import::CLI do
19
19
  subject.arguments << "--listen"
20
20
  subject.should be_listen_mode
21
21
  end
22
-
22
+
23
23
  end
24
24
 
25
25
  describe "dry_run?" do
26
-
26
+
27
27
  it "should return true when --dry-run is specified" do
28
28
  subject.arguments << "--dry-run"
29
29
  subject.should be_dry_run
@@ -32,7 +32,7 @@ describe Rivendell::Import::CLI do
32
32
  end
33
33
 
34
34
  describe "debug?" do
35
-
35
+
36
36
  it "should return true when --debug is specified" do
37
37
  subject.arguments << "--debug"
38
38
  subject.should be_debug
@@ -41,7 +41,7 @@ describe Rivendell::Import::CLI do
41
41
  end
42
42
 
43
43
  describe "syslog?" do
44
-
44
+
45
45
  it "should return true when --syslog is specified" do
46
46
  subject.arguments << "--syslog"
47
47
  subject.should be_syslog
@@ -50,7 +50,7 @@ describe Rivendell::Import::CLI do
50
50
  end
51
51
 
52
52
  describe "daemonize?" do
53
-
53
+
54
54
  it "should return true when --daemon is specified" do
55
55
  subject.arguments << "--daemon"
56
56
  subject.should be_daemonize
@@ -59,7 +59,7 @@ describe Rivendell::Import::CLI do
59
59
  end
60
60
 
61
61
  describe "pid_directory" do
62
-
62
+
63
63
  it "should return directory given with --pid-dir" do
64
64
  subject.arguments << "--pid-dir" << "dummy"
65
65
  subject.pid_directory.should == "dummy"
@@ -80,7 +80,7 @@ describe Rivendell::Import::CLI do
80
80
  end
81
81
 
82
82
  describe "#paths" do
83
-
83
+
84
84
  it "should return arguments after options" do
85
85
  subject.arguments << "--listen"
86
86
  subject.arguments << "file1" << "file2"
@@ -90,7 +90,7 @@ describe Rivendell::Import::CLI do
90
90
  end
91
91
 
92
92
  describe "#database" do
93
-
93
+
94
94
  it "should return file specified with --dabase" do
95
95
  subject.arguments << "--database" << "tasks.sqlite3"
96
96
  subject.database.should == "tasks.sqlite3"
@@ -132,7 +132,7 @@ describe Rivendell::Import::CLI do
132
132
  subject.stub :listen_mode? => true
133
133
  subject.stub :paths => [directory]
134
134
  end
135
-
135
+
136
136
  it "should use listen import" do
137
137
  subject.import.should_receive(:listen).with(directory, {})
138
138
  subject.run
@@ -156,7 +156,7 @@ describe Rivendell::Import::CLI do
156
156
  before(:each) do
157
157
  subject.stub :listen_mode? => false
158
158
  end
159
-
159
+
160
160
  it "should use process import" do
161
161
  subject.import.should_receive(:process).with(subject.paths)
162
162
  subject.run
@@ -179,11 +179,11 @@ describe Rivendell::Import::CLI do
179
179
  end
180
180
 
181
181
  end
182
-
182
+
183
183
  end
184
184
 
185
185
  describe "#setup_logger" do
186
-
186
+
187
187
  context " with syslog option" do
188
188
 
189
189
  before do
@@ -200,7 +200,7 @@ describe Rivendell::Import::CLI do
200
200
  end
201
201
 
202
202
  describe "#config_loader" do
203
-
203
+
204
204
  it "should use config_file" do
205
205
  subject.config_loader.file.should == subject.config_file
206
206
  end
@@ -5,9 +5,10 @@ describe Rivendell::Import::Tasks do
5
5
  let(:file) { Rivendell::Import::File.new "dummy.wav" }
6
6
 
7
7
  describe "#run" do
8
-
9
- it "should run each task" do
8
+
9
+ it "should run each ready task" do
10
10
  task = subject.create(file)
11
+ subject.stub :ready_tasks => [task]
11
12
  subject.run rescue nil
12
13
  task.reload.status.should_not be_pending
13
14
  end