Skip to content
This repository was archived by the owner on Sep 15, 2018. It is now read-only.

Commit d236a31

Browse files
committed
Ability to disable integration tests with config file
1 parent 8900768 commit d236a31

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
22
require File.expand_path(File.dirname(__FILE__) + '/../../lib/captured/uploaders/imageshack_uploader')
33

4-
describe "SCP File Uploader" do
5-
it "should upload to the server" do
6-
config = {"upload"=>{"url"=>"http://fuzzymonk.com/captured/",
7-
"type"=>"imageshack",
8-
"shackid"=>"capturedspec"}}
4+
if CONFIG['imageshack_spec']
5+
describe "Imageshack File Uploader" do
6+
it "should upload to the server" do
7+
config = {"upload"=>{"url"=>"http://fuzzymonk.com/captured/",
8+
"type"=>"imageshack",
9+
"shackid"=>"capturedspec"}}
910

10-
@uploader = ImageshackUploader.new(config)
11-
@uploader.upload(File.expand_path(File.dirname(__FILE__) + '/../../resources/captured.png'))
12-
system "open #{@uploader.url}"
11+
@uploader = ImageshackUploader.new(config)
12+
@uploader.upload(File.expand_path(File.dirname(__FILE__) + '/../../resources/captured.png'))
13+
system "open #{@uploader.url}"
14+
end
1315
end
1416
end
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
22
require File.expand_path(File.dirname(__FILE__) + '/../../lib/captured/uploaders/scp_uploader')
33

4-
describe "SCP File Uploader" do
5-
it "should upload to the server" do
6-
# This spec requires a scp_spec section in the config file with the
7-
# scp settings
8-
config = YAML.load_file("#{ENV['HOME']}/.captured.yml")['scp_spec']
9-
@uploader = ScpUploader.new(config)
10-
@uploader.upload(File.expand_path(File.dirname(__FILE__) + '/../../resources/captured.png'))
11-
system "open #{@uploader.url}"
4+
if CONFIG['scp_spec']
5+
describe "SCP File Uploader" do
6+
it "should upload to the server" do
7+
# This spec requires a scp_spec section in the config file with the
8+
# scp settings
9+
config = YAML.load_file("#{ENV['HOME']}/.captured.yml")['scp_spec']
10+
@uploader = ScpUploader.new(config)
11+
@uploader.upload(File.expand_path(File.dirname(__FILE__) + '/../../resources/captured.png'))
12+
system "open #{@uploader.url}"
13+
end
1214
end
1315
end

0 commit comments

Comments
 (0)