Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unused config constructor

  • Loading branch information...
commit fe4be8bccbec904ca9ce581be054f24306453a85 1 parent 153316a
@joshuaclayton joshuaclayton authored
View
2  lib/kumade/cli.rb
@@ -16,7 +16,7 @@ def initialize(args = ARGV, out = StringIO.new)
parse_arguments!(args)
Kumade.configuration.pretending = !!@options[:pretend]
- Kumade.configuration.environment = args.shift || 'staging'
+ Kumade.configuration.environment = args.shift
self.class.swapping_stdout_for(out, print_output?) do
deploy
View
11 lib/kumade/configuration.rb
@@ -1,14 +1,13 @@
module Kumade
class Configuration
- def initialize(environment = 'staging', pretending = false )
- @environment = environment
- @pretending = pretending
- end
+ attr_writer :pretending, :environment
def pretending?
- @pretending
+ @pretending || false
end
- attr_accessor :pretending, :environment
+ def environment
+ @environment || "staging"
+ end
end
end
View
6 spec/kumade/cli_spec.rb
@@ -16,7 +16,7 @@
context pretend_flag do
it "sets pretending to true" do
subject
- Kumade.configuration.pretending.should == true
+ Kumade.configuration.should be_pretending
end
it "deploys" do
@@ -36,7 +36,7 @@
end
it "sets pretending to false" do
- Kumade.configuration.pretending.should == false
+ Kumade.configuration.should_not be_pretending
end
end
@@ -45,7 +45,7 @@
it "sets pretending to false" do
subject
- Kumade.configuration.pretending.should == false
+ Kumade.configuration.should_not be_pretending
end
it "deploys" do
View
4 spec/kumade/configuration_spec.rb
@@ -8,7 +8,7 @@
describe Kumade::Configuration, "#pretending" do
it "has read/write access for the pretending attribute" do
subject.pretending = true
- subject.pretending.should == true
+ subject.should be_pretending
end
end
@@ -24,7 +24,7 @@
end
it "defaults to false" do
- subject.pretending.should == false
+ subject.should_not be_pretending
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.