Permalink
Browse files

deprecate share_as

  • Loading branch information...
1 parent 60310ae commit 9d8f4f8202a0c9a356dd840e7dbd618c2083dbcb @dchelimsky committed Sep 19, 2010
Showing with 294 additions and 333 deletions.
  1. +5 −2 History.rdoc
  2. +0 −36 examples/passing/shared_example_group_example.rb
  3. +1 −0 lib/spec/dsl/main.rb
  4. +10 −2 spec/spec/dsl/main_spec.rb
  5. +278 −293 spec/spec/matchers/have_spec.rb
View
@@ -1,15 +1,18 @@
=== Version 1.3.1 / (Date TBD)
-* Enhancements
+* enhancements
* Array =~ matcher works with subclasses of Array (Matthew Peychich & Pat Maddox)
-* bug fix
+* bug fixes
* QuitBacktraceTweaker no longer eats all paths with 'lib'
(Tim Harper - #912)
* Fix delegation of stubbed values on superclass class-level methods.
(Scott Taylor - #496 - #957)
* Fix pending to work with ruby-1.9
+* deprecations
+ * share_as (will be removed from rspec-2.0)
+
=== Version 1.3.0 / 2010-01-11
* enhancements
@@ -29,18 +29,6 @@ def helper_method
end
end
- # A SharedExampleGroup is also a module. If you create one like this it gets
- # assigned to the constant MostThings
- share_as :MostThings do
- def helper_method
- "helper method"
- end
-
- it "should do what things do" do
- @thing.what_things_do.should == "stuff"
- end
- end
-
describe OneThing do
# Now you can include the shared example group like this, which
# feels more like what you might say ...
@@ -52,28 +40,4 @@ def helper_method
helper_method.should == "helper method"
end
end
-
- describe AnotherThing do
- # ... or you can include the example group like this, which
- # feels more like the programming language we love.
- it_should_behave_like MostThings
-
- before(:each) { @thing = AnotherThing.new }
-
- it "should have access to helper methods defined in the shared example group" do
- helper_method.should == "helper method"
- end
- end
-
- describe YetAnotherThing do
- # ... or you can include the example group like this, which
- # feels more like the programming language we love.
- include MostThings
-
- before(:each) { @thing = AnotherThing.new }
-
- it "should have access to helper methods defined in the shared example group" do
- helper_method.should == "helper method"
- end
- end
end
@@ -76,6 +76,7 @@ def share_examples_for(*args, &block)
# end
# end
def share_as(name, &block)
+ Spec.deprecate("share_as","shared_examples_for")
begin
args = [name]
add_options(args)
@@ -57,7 +57,6 @@ module Bar
end
end
-
describe "#share_as" do
def self.next_group_name
@group_number ||= 0
@@ -68,6 +67,15 @@ def self.next_group_name
def group_name
@group_name ||= self.class.next_group_name
end
+
+ before(:each) do
+ Spec.stub(:deprecate)
+ end
+
+ it "is deprecated" do
+ Spec.should_receive(:deprecate)
+ share_as group_name do; end
+ end
it "registers a shared ExampleGroup" do
block = lambda {|a,b|}
@@ -92,4 +100,4 @@ def group_name
end
end
end
-
+
Oops, something went wrong.

0 comments on commit 9d8f4f8

Please sign in to comment.