mspec 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +93 -0
- data/lib/mspec/commands/mspec-ci.rb +2 -0
- data/lib/mspec/matchers.rb +4 -3
- data/lib/mspec/matchers/equal_element.rb +78 -0
- data/lib/mspec/runner/context.rb +138 -52
- data/lib/mspec/runner/example.rb +17 -20
- data/lib/mspec/runner/mspec.rb +38 -13
- data/lib/mspec/runner/object.rb +5 -1
- data/lib/mspec/runner/shared.rb +6 -6
- data/lib/mspec/version.rb +1 -1
- data/spec/commands/mspec_ci_spec.rb +14 -0
- data/spec/matchers/equal_element_spec.rb +75 -0
- data/spec/runner/actions/debug_spec.rb +2 -1
- data/spec/runner/actions/gdb_spec.rb +1 -1
- data/spec/runner/actions/tag_spec.rb +7 -4
- data/spec/runner/context_spec.rb +422 -57
- data/spec/runner/example_spec.rb +53 -37
- data/spec/runner/exception_spec.rb +9 -5
- data/spec/runner/formatters/dotted_spec.rb +4 -3
- data/spec/runner/formatters/html_spec.rb +4 -3
- data/spec/runner/formatters/specdoc_spec.rb +3 -2
- data/spec/runner/formatters/summary_spec.rb +2 -1
- data/spec/runner/formatters/unit_spec.rb +2 -1
- data/spec/runner/formatters/yaml_spec.rb +2 -1
- data/spec/runner/mspec_spec.rb +87 -23
- data/spec/runner/shared_spec.rb +14 -28
- metadata +3 -1
data/spec/runner/shared_spec.rb
CHANGED
@@ -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 "
|
17
|
-
|
18
|
-
|
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 "
|
25
|
-
|
26
|
-
|
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 "
|
33
|
-
|
34
|
-
|
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.
|
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
|