mspec 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +1,27 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
  require 'mspec/runner/shared'
3
3
 
4
- describe Object, "#shared" do
5
- it "stores the passed block in the MSpec module" do
6
- proc = lambda { :shared }
7
- shared :shared, &proc
8
- MSpec.retrieve(:shared).should == proc
9
- end
10
- end
11
-
12
4
  describe Object, "#it_behaves_like" do
13
5
  before :each do
6
+ @recv = Object.new
7
+ def @recv.before(what)
8
+ yield
9
+ end
10
+ @recv.stub!(:it_should_behave_like)
14
11
  end
15
12
 
16
- it "retrieves the instance variable set on Object and calls the proc" do
17
- proc = lambda { |a| raise Exception, "visited with #{a.inspect}" }
18
- shared :shared, &proc
19
- lambda {
20
- it_behaves_like(:shared, nil)
21
- }.should raise_error(Exception, "visited with nil")
13
+ it "creates @method set to the name of the aliased method" do
14
+ @recv.it_behaves_like "something", :some_method
15
+ @recv.instance_variable_get(:@method).should == :some_method
22
16
  end
23
17
 
24
- it "accepts an optional argument to specify the class/module" do
25
- proc = lambda { |a, b| raise Exception, "visited with #{a.inspect}, #{b.inspect}" }
26
- shared :shared, &proc
27
- lambda {
28
- it_behaves_like(:shared, :method, :klass)
29
- }.should raise_error(Exception, "visited with :method, :klass")
18
+ it "creates @object if the passed object is not nil" do
19
+ @recv.it_behaves_like "something", :some_method, :some_object
20
+ @recv.instance_variable_get(:@object).should == :some_object
30
21
  end
31
22
 
32
- it "accepts an optional argument to specify the class/module name" do
33
- proc = lambda { |a, b, c|
34
- raise Exception, "visited with #{a.inspect}, #{b.inspect}, #{c.inspect}"
35
- }
36
- shared :shared, &proc
37
- lambda {
38
- it_behaves_like(:shared, :method, :klass, :name)
39
- }.should raise_error(Exception, "visited with :method, :klass, :name")
23
+ it "sends :it_should_behave_like" do
24
+ @recv.should_receive(:it_should_behave_like)
25
+ @recv.it_behaves_like "something", :some_method
40
26
  end
41
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Ford
@@ -67,6 +67,7 @@ files:
67
67
  - lib/mspec/matchers/complain.rb
68
68
  - lib/mspec/matchers/eql.rb
69
69
  - lib/mspec/matchers/equal.rb
70
+ - lib/mspec/matchers/equal_element.rb
70
71
  - lib/mspec/matchers/equal_utf16.rb
71
72
  - lib/mspec/matchers/include.rb
72
73
  - lib/mspec/matchers/match_yaml.rb
@@ -150,6 +151,7 @@ files:
150
151
  - spec/matchers/be_true_spec.rb
151
152
  - spec/matchers/complain_spec.rb
152
153
  - spec/matchers/eql_spec.rb
154
+ - spec/matchers/equal_element_spec.rb
153
155
  - spec/matchers/equal_spec.rb
154
156
  - spec/matchers/equal_utf16_spec.rb
155
157
  - spec/matchers/include_spec.rb