moses 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
data/lib/moses.rb CHANGED
@@ -82,7 +82,7 @@ module Moses
82
82
  end
83
83
 
84
84
  def parse_command
85
- unless @default_command
85
+ unless default_command
86
86
  @command = @args.shift.to_sym if @args.first && @args.first.respond_to?(:to_sym)
87
87
  end
88
88
  end
data/moses.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "moses"
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dayton Nolan"]
data/spec/moses_spec.rb CHANGED
@@ -119,14 +119,27 @@ describe Moses do
119
119
  end
120
120
 
121
121
  describe "default_command" do
122
- it "can be set with the class method" do
122
+ before do
123
123
  class CustomDefaultCommandClass
124
124
  include Moses
125
125
  default_command :some_command
126
+
127
+ def some_command
128
+ end
126
129
  end
127
130
  @dc_app = CustomDefaultCommandClass.new
131
+ end
132
+
133
+ it "can be set with the class method" do
128
134
  expect(@dc_app.default_command).to eq(:some_command)
129
135
  end
136
+
137
+ it "doesn't overwrite the default command when passed arguments" do
138
+ ARGV = ['test']
139
+ @dc_app.run
140
+ expect(@dc_app.command).to be_nil
141
+ expect(@dc_app.args.first).to eq('test')
142
+ end
130
143
  end
131
144
 
132
145
  describe 'option commands' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: 3603360791257642318
153
+ hash: -1695621889216618281
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  none: false
156
156
  requirements: