Permalink
Browse files

Remove unused config constructor

  • Loading branch information...
1 parent 153316a commit fe4be8bccbec904ca9ce581be054f24306453a85 @joshuaclayton joshuaclayton committed Sep 15, 2011
Showing with 11 additions and 12 deletions.
  1. +1 −1 lib/kumade/cli.rb
  2. +5 −6 lib/kumade/configuration.rb
  3. +3 −3 spec/kumade/cli_spec.rb
  4. +2 −2 spec/kumade/configuration_spec.rb
View
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit fe4be8b

Please sign in to comment.