Skip to content

Commit

Permalink
working to update test to rspec 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wbailey committed Jun 11, 2014
1 parent 3680277 commit 8e56e64
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
24 changes: 14 additions & 10 deletions Gemfile.lock
Expand Up @@ -7,12 +7,12 @@ GEM
autotest-fsevent (0.2.9) autotest-fsevent (0.2.9)
sys-uname sys-uname
autotest-growl (0.2.16) autotest-growl (0.2.16)
aws-sdk (1.40.3) aws-sdk (1.42.0)
json (~> 1.4) json (~> 1.4)
nokogiri (>= 1.4.4) nokogiri (>= 1.4.4)
colored (1.2) colored (1.2)
columnize (0.8.9) columnize (0.8.9)
command_line_reporter (3.3.1) command_line_reporter (3.3.2)
colored (>= 1.2) colored (>= 1.2)
debugger-linecache (1.2.0) debugger-linecache (1.2.0)
debugger2 (1.0.0.beta2) debugger2 (1.0.0.beta2)
Expand All @@ -25,14 +25,18 @@ GEM
nokogiri (1.6.2.1) nokogiri (1.6.2.1)
mini_portile (= 0.6.0) mini_portile (= 0.6.0)
rake (10.3.2) rake (10.3.2)
rspec (2.14.1) rspec (3.0.0)
rspec-core (~> 2.14.0) rspec-core (~> 3.0.0)
rspec-expectations (~> 2.14.0) rspec-expectations (~> 3.0.0)
rspec-mocks (~> 2.14.0) rspec-mocks (~> 3.0.0)
rspec-core (2.14.8) rspec-core (3.0.0)
rspec-expectations (2.14.5) rspec-support (~> 3.0.0)
diff-lcs (>= 1.1.3, < 2.0) rspec-expectations (3.0.0)
rspec-mocks (2.14.6) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-mocks (3.0.1)
rspec-support (~> 3.0.0)
rspec-support (3.0.0)
sys-uname (0.9.2) sys-uname (0.9.2)
ffi (>= 1.0.0) ffi (>= 1.0.0)


Expand Down
24 changes: 12 additions & 12 deletions spec/options_spec.rb
Expand Up @@ -11,58 +11,58 @@ def cli(args)
it 'defines default options' do it 'defines default options' do
cli %w{production app} do cli %w{production app} do
options = Claws::Options.parse options = Claws::Options.parse
options.connect.should be_true expect(options.connect).to be(true)
options.source.should == 'ec2' expect(options.source).to eq('ec2')
options.selection.should be_nil expect(options.selection).to be(nil)
end end
end end


it 'accepts display only flag' do it 'accepts display only flag' do
# By default we want to connect to the instance # By default we want to connect to the instance
Claws::Options.parse.connect.should be_true expect(Claws::Options.parse.connect).to be(true)


# Allow the user to override and just display information # Allow the user to override and just display information
cli %w{-d} do cli %w{-d} do
Claws::Options.parse.connect.should be_false expect(Claws::Options.parse.connect).to be(false)
end end


cli %w{--display-only} do cli %w{--display-only} do
Claws::Options.parse.connect.should be_false expect(Claws::Options.parse.connect).to be(false)
end end
end end


it 'accepts a choice flag' do it 'accepts a choice flag' do
cli %w{-c 10} do cli %w{-c 10} do
Claws::Options.parse.selection.should == 10 expect(Claws::Options.parse.selection).to eq(10)
end end


cli %w{--choice 10} do cli %w{--choice 10} do
Claws::Options.parse.selection.should == 10 expect(Claws::Options.parse.selection).to eq(10)
end end
end end


it 'accepts a source flag' do it 'accepts a source flag' do
cli %w{-s elb} do cli %w{-s elb} do
options = Claws::Options.parse options = Claws::Options.parse
options.source.should == 'elb' expect(options.source).to eq('elb')
end end


cli %w{--source elb} do cli %w{--source elb} do
options = Claws::Options.parse options = Claws::Options.parse
options.source.should == 'elb' expect(options.source).to eq('elb')
end end
end end


context 'capistrano' do context 'capistrano' do
it 'defines the environment' do it 'defines the environment' do
cli %w{production app} do cli %w{production app} do
Claws::Options.parse.environment.should == 'production' expect(Claws::Options.parse.environment).to eq('production')
end end
end end


it 'defines the role' do it 'defines the role' do
cli %w{production app} do cli %w{production app} do
Claws::Options.parse.role.should == 'app' expect(Claws::Options.parse.role).to eq('app')
end end
end end
end end
Expand Down

0 comments on commit 8e56e64

Please sign in to comment.