diff options
Diffstat (limited to 'spec/lib/rake/javaextensiontask_spec.rb')
-rw-r--r-- | spec/lib/rake/javaextensiontask_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/lib/rake/javaextensiontask_spec.rb b/spec/lib/rake/javaextensiontask_spec.rb index 06ba2f5..353c40f 100644 --- a/spec/lib/rake/javaextensiontask_spec.rb +++ b/spec/lib/rake/javaextensiontask_spec.rb @@ -76,9 +76,14 @@ describe Rake::JavaExtensionTask do @ext.config_options.should be_empty end + it 'should have no lint option preset to delegate' do + @ext.lint_option.should be_falsey + end + it 'should default to Java platform' do @ext.platform.should == 'java' end + end context '(tasks)' do before :each do @@ -165,6 +170,31 @@ describe Rake::JavaExtensionTask do end end end + + context 'A custom extension' do + let(:extension) do + Rake::JavaExtensionTask.new('extension_two') do |ext| + ext.lint_option = lint_option if lint_option + end + end + + context 'without a specified lint option' do + let(:lint_option) { nil } + + it 'should honor the lint option' do + (extension.lint_option).should be_falsey + (extension.send :java_lint_arg, extension.lint_option).should eq '-Xlint' + end + end + + context "with a specified lint option of 'deprecated'" do + let(:lint_option) { 'deprecated'.freeze } + + it 'should honor the lint option' do + (extension.lint_option).should eq lint_option + (extension.send :java_lint_arg, extension.lint_option).should eq '-Xlint:deprecated' + end + end end end private |