forked from flapjack/flapjack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commented out spec until we (possibly) re-add command line arguments …
…later on
- Loading branch information
Showing
1 changed file
with
115 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,115 @@ | ||
require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier') | ||
|
||
describe Flapjack::Notifier::Options do | ||
|
||
# beanstalk | ||
it "should accept the location of a beanstalk queue in short form" do | ||
args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.host.should == "localhost" | ||
end | ||
|
||
it "should accept the location of a beanstalk queue in long form" do | ||
args = %w(--beanstalk localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.host.should == "localhost" | ||
end | ||
|
||
it "should set a default beanstalk host" do | ||
args = %w(-r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.host.should == 'localhost' | ||
end | ||
|
||
# beanstalk port | ||
it "should accept a specified beanstalk port in short form" do | ||
args = %w(-b localhost -p 11340 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.port.should == 11340 | ||
end | ||
|
||
it "should accept a specified beanstalk port in long form" do | ||
args = %w(-b localhost --port 11399 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.port.should == 11399 | ||
end | ||
|
||
it "should set a default beanstalk port" do | ||
args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.port.should == 11300 | ||
end | ||
|
||
# recipients | ||
it "should accept the location of a recipients file in short form" do | ||
args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.recipients.should == "spec/recipients.yaml" | ||
end | ||
|
||
it "should accept the location of a recipients file in long form" do | ||
args = %w(-b localhost --recipient spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.recipients.should == "spec/recipients.yaml" | ||
end | ||
|
||
it "should exit if the recipients file doesn't exist" do | ||
args = %w(-b localhost -r spec/wangity.yaml -c spec/flapjack-notifier.yaml) | ||
lambda { | ||
Flapjack::Notifier::Options.parse(args) | ||
}.should raise_error(SystemExit) | ||
end | ||
|
||
it "should exit if the recipients file isn't specified" do | ||
args = %w(-b localhost -c spec/flapjack-notifier.yaml) | ||
lambda { | ||
Flapjack::Notifier::Options.parse(args) | ||
}.should raise_error(SystemExit) | ||
end | ||
|
||
# config | ||
it "should accept the location of a config file in short form" do | ||
args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.config_filename.should == "spec/flapjack-notifier.yaml" | ||
end | ||
|
||
it "should accept the location of a config file in long form" do | ||
args = %w(-b localhost -r spec/recipients.yaml --config spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.config_filename.should == "spec/flapjack-notifier.yaml" | ||
end | ||
|
||
it "should provide a default config file if not specified" do | ||
args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
options = Flapjack::Notifier::Options.parse(args) | ||
options.config_filename.should_not be_nil | ||
end | ||
|
||
it "should exit if the config file doesn't exist" do | ||
args = %w(-b localhost --config spec/wangity.yaml) | ||
lambda { | ||
Flapjack::Notifier::Options.parse(args) | ||
}.should raise_error(SystemExit) | ||
end | ||
|
||
# general | ||
it "should exit when asked for help in short form" do | ||
args = %w(-h) | ||
lambda { | ||
Flapjack::Notifier::Options.parse(args) | ||
}.should raise_error(SystemExit) | ||
end | ||
|
||
it "should exit when asked for help in long form" do | ||
args = %w(--help) | ||
lambda { | ||
Flapjack::Notifier::Options.parse(args) | ||
}.should raise_error(SystemExit) | ||
end | ||
end | ||
|
||
|
||
def puts(*args) ; end | ||
##!/usr/bin/env ruby | ||
## | ||
#require File.join(File.dirname(__FILE__), '..', 'lib', 'flapjack', 'cli', 'notifier') | ||
# | ||
#describe Flapjack::Notifier::Options do | ||
# | ||
# # beanstalk | ||
# it "should accept the location of a beanstalk queue in short form" do | ||
# args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.host.should == "localhost" | ||
# end | ||
# | ||
# it "should accept the location of a beanstalk queue in long form" do | ||
# args = %w(--beanstalk localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.host.should == "localhost" | ||
# end | ||
# | ||
# it "should set a default beanstalk host" do | ||
# args = %w(-r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.host.should == 'localhost' | ||
# end | ||
# | ||
# # beanstalk port | ||
# it "should accept a specified beanstalk port in short form" do | ||
# args = %w(-b localhost -p 11340 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.port.should == 11340 | ||
# end | ||
# | ||
# it "should accept a specified beanstalk port in long form" do | ||
# args = %w(-b localhost --port 11399 -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.port.should == 11399 | ||
# end | ||
# | ||
# it "should set a default beanstalk port" do | ||
# args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.port.should == 11300 | ||
# end | ||
# | ||
# # recipients | ||
# it "should accept the location of a recipients file in short form" do | ||
# args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.recipients.should == "spec/recipients.yaml" | ||
# end | ||
# | ||
# it "should accept the location of a recipients file in long form" do | ||
# args = %w(-b localhost --recipient spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.recipients.should == "spec/recipients.yaml" | ||
# end | ||
# | ||
# it "should exit if the recipients file doesn't exist" do | ||
# args = %w(-b localhost -r spec/wangity.yaml -c spec/flapjack-notifier.yaml) | ||
# lambda { | ||
# Flapjack::Notifier::Options.parse(args) | ||
# }.should raise_error(SystemExit) | ||
# end | ||
# | ||
# it "should exit if the recipients file isn't specified" do | ||
# args = %w(-b localhost -c spec/flapjack-notifier.yaml) | ||
# lambda { | ||
# Flapjack::Notifier::Options.parse(args) | ||
# }.should raise_error(SystemExit) | ||
# end | ||
# | ||
# # config | ||
# it "should accept the location of a config file in short form" do | ||
# args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.config_filename.should == "spec/flapjack-notifier.yaml" | ||
# end | ||
# | ||
# it "should accept the location of a config file in long form" do | ||
# args = %w(-b localhost -r spec/recipients.yaml --config spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.config_filename.should == "spec/flapjack-notifier.yaml" | ||
# end | ||
# | ||
# it "should provide a default config file if not specified" do | ||
# args = %w(-b localhost -r spec/recipients.yaml -c spec/flapjack-notifier.yaml) | ||
# options = Flapjack::Notifier::Options.parse(args) | ||
# options.config_filename.should_not be_nil | ||
# end | ||
# | ||
# it "should exit if the config file doesn't exist" do | ||
# args = %w(-b localhost --config spec/wangity.yaml) | ||
# lambda { | ||
# Flapjack::Notifier::Options.parse(args) | ||
# }.should raise_error(SystemExit) | ||
# end | ||
# | ||
# # general | ||
# it "should exit when asked for help in short form" do | ||
# args = %w(-h) | ||
# lambda { | ||
# Flapjack::Notifier::Options.parse(args) | ||
# }.should raise_error(SystemExit) | ||
# end | ||
# | ||
# it "should exit when asked for help in long form" do | ||
# args = %w(--help) | ||
# lambda { | ||
# Flapjack::Notifier::Options.parse(args) | ||
# }.should raise_error(SystemExit) | ||
# end | ||
#end | ||
# | ||
# | ||
#def puts(*args) ; end |