You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2018/11/18 22:22:41 UTC

[5/8] buildr git commit: RSpec.shared_examples syntax

RSpec.shared_examples syntax


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/70aa2734
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/70aa2734
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/70aa2734

Branch: refs/heads/master
Commit: 70aa2734b86279c657fd43b0fa54794ce0b7a336
Parents: a40e636
Author: Olle Jonsson <ol...@gmail.com>
Authored: Sat Nov 17 23:01:07 2018 +0100
Committer: Olle Jonsson <ol...@gmail.com>
Committed: Sat Nov 17 23:01:07 2018 +0100

----------------------------------------------------------------------
 spec/core/build_spec.rb            | 4 ++--
 spec/core/checks_spec.rb           | 2 +-
 spec/core/compile_spec.rb          | 2 +-
 spec/core/shell_spec.rb            | 2 +-
 spec/ide/eclipse_spec.rb           | 2 +-
 spec/java/packaging_spec.rb        | 6 +++---
 spec/java/test_coverage_helper.rb  | 2 +-
 spec/kotlin/compiler_spec.rb       | 6 +++---
 spec/packaging/archive_spec.rb     | 2 +-
 spec/packaging/packaging_helper.rb | 2 +-
 spec/scala/compiler_spec.rb        | 4 ++--
 11 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/core/build_spec.rb
----------------------------------------------------------------------
diff --git a/spec/core/build_spec.rb b/spec/core/build_spec.rb
index b1953c7..8df189a 100644
--- a/spec/core/build_spec.rb
+++ b/spec/core/build_spec.rb
@@ -16,7 +16,7 @@
 
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
 
-shared_examples_for 'local task' do
+RSpec.shared_examples 'local task' do
   it "should execute task for project in current directory" do
     define 'foobar'
     lambda { @task.invoke }.should run_task("foobar:#{@task.name}")
@@ -387,7 +387,7 @@ describe Release do
 end
 
 
-shared_examples_for 'a release process' do
+RSpec.shared_examples 'a release process' do
 
   describe '#make' do
     before do

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/core/checks_spec.rb
----------------------------------------------------------------------
diff --git a/spec/core/checks_spec.rb b/spec/core/checks_spec.rb
index 4232bff..edb152c 100644
--- a/spec/core/checks_spec.rb
+++ b/spec/core/checks_spec.rb
@@ -343,7 +343,7 @@ end
 
 describe Buildr::Checks::Expectation do
 
-  shared_examples_for 'all archive types' do
+  RSpec.shared_examples 'all archive types' do
 
     before do
       archive = @archive

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/core/compile_spec.rb
----------------------------------------------------------------------
diff --git a/spec/core/compile_spec.rb b/spec/core/compile_spec.rb
index 69e5037..f3f23d1 100644
--- a/spec/core/compile_spec.rb
+++ b/spec/core/compile_spec.rb
@@ -428,7 +428,7 @@ describe Buildr::CompileTask, '#invoke' do
 end
 
 
-shared_examples_for 'accessor task' do
+RSpec.shared_examples 'accessor task' do
   it 'should return a task' do
     define('foo').send(@task_name).should be_kind_of(Rake::Task)
   end

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/core/shell_spec.rb
----------------------------------------------------------------------
diff --git a/spec/core/shell_spec.rb b/spec/core/shell_spec.rb
index b8766e1..c571307 100644
--- a/spec/core/shell_spec.rb
+++ b/spec/core/shell_spec.rb
@@ -102,7 +102,7 @@ describe Project, '.shell' do
   end
 end
 
-shared_examples_for "shell provider" do
+RSpec.shared_examples "shell provider" do
 
   it 'should have launch method accepting shell task' do
     @instance.method(:launch).should_not be_nil

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/ide/eclipse_spec.rb
----------------------------------------------------------------------
diff --git a/spec/ide/eclipse_spec.rb b/spec/ide/eclipse_spec.rb
index 7ecb2bc..f50af1a 100644
--- a/spec/ide/eclipse_spec.rb
+++ b/spec/ide/eclipse_spec.rb
@@ -382,7 +382,7 @@ MANIFEST
         write 'src/test/java/Test.java'
       end
 
-      shared_examples_for 'source' do
+      RSpec.shared_examples 'source' do
         it 'should ignore CVS and SVN files' do
           define('foo')
           classpath_sources('excluding').each do |excluding_attribute|

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/java/packaging_spec.rb
----------------------------------------------------------------------
diff --git a/spec/java/packaging_spec.rb b/spec/java/packaging_spec.rb
index a13f4a4..499fb10 100644
--- a/spec/java/packaging_spec.rb
+++ b/spec/java/packaging_spec.rb
@@ -53,7 +53,7 @@ describe Project, '#manifest' do
 end
 
 
-shared_examples_for 'package with manifest' do
+RSpec.shared_examples 'package with manifest' do
   before do
     @long_line = 'No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).'
   end
@@ -347,7 +347,7 @@ describe Project, '#meta_inf' do
 end
 
 
-shared_examples_for 'package with meta_inf' do
+RSpec.shared_examples 'package with meta_inf' do
 
   def package_with_meta_inf(meta_inf = nil)
     packaging = @packaging
@@ -1258,7 +1258,7 @@ describe Packaging, 'test_jar' do
   end
 end
 
-shared_examples_for 'package_with_' do
+RSpec.shared_examples 'package_with_' do
 
   def prepare(options = {})
     packager = "package_with_#{@packaging}"

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/java/test_coverage_helper.rb
----------------------------------------------------------------------
diff --git a/spec/java/test_coverage_helper.rb b/spec/java/test_coverage_helper.rb
index 1651c97..ae72c0c 100644
--- a/spec/java/test_coverage_helper.rb
+++ b/spec/java/test_coverage_helper.rb
@@ -53,7 +53,7 @@ module TestCoverageHelper
   end
 end
 
-shared_examples_for 'test coverage tool' do
+RSpec.shared_examples 'test coverage tool' do
   include TestCoverageHelper
 
   def toolname

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/kotlin/compiler_spec.rb
----------------------------------------------------------------------
diff --git a/spec/kotlin/compiler_spec.rb b/spec/kotlin/compiler_spec.rb
index 200f60a..aa2f1c1 100644
--- a/spec/kotlin/compiler_spec.rb
+++ b/spec/kotlin/compiler_spec.rb
@@ -17,7 +17,7 @@
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
 
 # need to test both with and without KOTLIN_HOME
-share_as :KotlincCompiler do
+RSpec.shared_examples 'KotlincCompiler' do
 
   it 'should identify itself from source directories' do
     write 'src/main/kotlin/com/example/Test.kt', "package com.example\n class Test { }"
@@ -110,7 +110,7 @@ share_as :KotlincCompiler do
   end
 end
 
-share_as :KotlincCompiler_CommonOptions do
+RSpec.shared_examples 'KotlincCompiler_CommonOptions' do
 
   it 'should set warnings option to false by default' do
     compile_task.options.warnings.should be_false
@@ -271,4 +271,4 @@ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.8"
       ENV['KOTLIN_HOME'] = old_home
     end
   end
-end
\ No newline at end of file
+end

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/packaging/archive_spec.rb
----------------------------------------------------------------------
diff --git a/spec/packaging/archive_spec.rb b/spec/packaging/archive_spec.rb
index 46f1151..827c4e8 100644
--- a/spec/packaging/archive_spec.rb
+++ b/spec/packaging/archive_spec.rb
@@ -60,7 +60,7 @@ module ArchiveTaskHelpers
   end
 end
 
-shared_examples_for 'ArchiveTask' do
+RSpec.shared_examples 'ArchiveTask' do
   include ArchiveTaskHelpers
 
   before(:each) do

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/packaging/packaging_helper.rb
----------------------------------------------------------------------
diff --git a/spec/packaging/packaging_helper.rb b/spec/packaging/packaging_helper.rb
index d555d03..76f2247 100644
--- a/spec/packaging/packaging_helper.rb
+++ b/spec/packaging/packaging_helper.rb
@@ -14,7 +14,7 @@
 # the License.
 
 
-shared_examples_for 'packaging' do
+RSpec.shared_examples 'packaging' do
   it 'should create artifact of proper type' do
     packaging = @packaging
     package_type = @package_type || @packaging

http://git-wip-us.apache.org/repos/asf/buildr/blob/70aa2734/spec/scala/compiler_spec.rb
----------------------------------------------------------------------
diff --git a/spec/scala/compiler_spec.rb b/spec/scala/compiler_spec.rb
index 509d567..a76608d 100644
--- a/spec/scala/compiler_spec.rb
+++ b/spec/scala/compiler_spec.rb
@@ -17,7 +17,7 @@
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
 
 # need to test both with and without SCALA_HOME
-share_as :ScalacCompiler do
+RSpec.shared_examples 'ScalacCompiler' do
 
   it 'should identify itself from source directories' do
     write 'src/main/scala/com/example/Test.scala', 'package com.example; class Test { val i = 1 }'
@@ -140,7 +140,7 @@ describe 'scala compiler (downloaded from repository)' do
   end
 end
 
-share_as :ScalacCompiler_CommonOptions do
+RSpec.shared_examples 'ScalacCompiler_CommonOptions' do
 
   it 'should set warnings option to false by default' do
     compile_task.options.warnings.should be_false