mspec 1.4.0 → 1.5.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.
- data/lib/mspec/commands/mkspec.rb +16 -22
- data/lib/mspec/commands/mspec-ci.rb +41 -50
- data/lib/mspec/commands/mspec-run.rb +46 -53
- data/lib/mspec/commands/mspec-tag.rb +81 -50
- data/lib/mspec/commands/mspec.rb +35 -26
- data/lib/mspec/guards.rb +1 -0
- data/lib/mspec/guards/guard.rb +2 -15
- data/lib/mspec/helpers.rb +1 -0
- data/lib/mspec/helpers/ruby_exe.rb +101 -0
- data/lib/mspec/ruby_name.rb +8 -0
- data/lib/mspec/runner/actions.rb +1 -0
- data/lib/mspec/runner/actions/filter.rb +1 -1
- data/lib/mspec/runner/actions/taglist.rb +56 -0
- data/lib/mspec/runner/filters/tag.rb +1 -1
- data/lib/mspec/runner/mspec.rb +3 -1
- data/lib/mspec/utils/options.rb +258 -195
- data/lib/mspec/utils/script.rb +11 -1
- data/lib/mspec/version.rb +1 -1
- data/spec/commands/mkspec_spec.rb +19 -18
- data/spec/commands/mspec_ci_spec.rb +13 -40
- data/spec/commands/mspec_run_spec.rb +14 -14
- data/spec/commands/mspec_spec.rb +41 -7
- data/spec/commands/mspec_tag_spec.rb +248 -15
- data/spec/helpers/ruby_exe_spec.rb +115 -0
- data/spec/runner/actions/filter_spec.rb +4 -4
- data/spec/runner/actions/tag_spec.rb +1 -5
- data/spec/runner/actions/taglist_spec.rb +152 -0
- data/spec/runner/filters/tag_spec.rb +1 -1
- data/spec/runner/mspec_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/utils/options_spec.rb +562 -283
- data/spec/utils/script_spec.rb +32 -0
- metadata +6 -1
data/spec/utils/script_spec.rb
CHANGED
@@ -161,6 +161,11 @@ describe MSpecScript, "#register" do
|
|
161
161
|
@formatter.should_receive(:register)
|
162
162
|
@script.register
|
163
163
|
end
|
164
|
+
|
165
|
+
it "does not register the formatter if config[:formatter] is nil" do
|
166
|
+
@script.config[:formatter] = nil
|
167
|
+
@script.register
|
168
|
+
end
|
164
169
|
end
|
165
170
|
|
166
171
|
describe MSpecScript, "#register" do
|
@@ -263,3 +268,30 @@ describe MSpecScript, "#signals" do
|
|
263
268
|
@script.signals
|
264
269
|
end
|
265
270
|
end
|
271
|
+
|
272
|
+
describe MSpecScript, "#files" do
|
273
|
+
before :each do
|
274
|
+
@script = MSpecScript.new
|
275
|
+
end
|
276
|
+
|
277
|
+
it "returns entries unchanged if they are files" do
|
278
|
+
stat = mock("Stat")
|
279
|
+
stat.stub!(:file?).and_return(true)
|
280
|
+
stat.stub!(:directory?).and_return(false)
|
281
|
+
File.stub!(:stat).and_return(stat)
|
282
|
+
@script.files(["a", "b"]).should == ["a", "b"]
|
283
|
+
end
|
284
|
+
|
285
|
+
it "searches for _spec.rb files if the entry is a directory" do
|
286
|
+
File.should_receive(:expand_path).with("some/dir").and_return("some/dir")
|
287
|
+
stat = mock("Stat")
|
288
|
+
stat.should_receive(:file?).and_return(false)
|
289
|
+
stat.should_receive(:directory?).and_return(true)
|
290
|
+
File.stub!(:stat).and_return(stat)
|
291
|
+
|
292
|
+
Dir.should_receive(:[]).with("some/dir/**/*_spec.rb").and_return(
|
293
|
+
["some/dir/file_spec.rb", "some/dir/other_spec.rb"])
|
294
|
+
@script.files(["some/dir"]).should ==
|
295
|
+
["some/dir/file_spec.rb", "some/dir/other_spec.rb"]
|
296
|
+
end
|
297
|
+
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.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Ford
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/mspec/helpers/const_lookup.rb
|
54
54
|
- lib/mspec/helpers/flunk.rb
|
55
55
|
- lib/mspec/helpers/io.rb
|
56
|
+
- lib/mspec/helpers/ruby_exe.rb
|
56
57
|
- lib/mspec/helpers/scratch.rb
|
57
58
|
- lib/mspec/helpers/tmp.rb
|
58
59
|
- lib/mspec/helpers.rb
|
@@ -79,10 +80,12 @@ files:
|
|
79
80
|
- lib/mspec/mocks/object.rb
|
80
81
|
- lib/mspec/mocks/proxy.rb
|
81
82
|
- lib/mspec/mocks.rb
|
83
|
+
- lib/mspec/ruby_name.rb
|
82
84
|
- lib/mspec/runner/actions/debug.rb
|
83
85
|
- lib/mspec/runner/actions/filter.rb
|
84
86
|
- lib/mspec/runner/actions/gdb.rb
|
85
87
|
- lib/mspec/runner/actions/tag.rb
|
88
|
+
- lib/mspec/runner/actions/taglist.rb
|
86
89
|
- lib/mspec/runner/actions/tally.rb
|
87
90
|
- lib/mspec/runner/actions/timer.rb
|
88
91
|
- lib/mspec/runner/actions.rb
|
@@ -139,6 +142,7 @@ files:
|
|
139
142
|
- spec/helpers/const_lookup_spec.rb
|
140
143
|
- spec/helpers/flunk_spec.rb
|
141
144
|
- spec/helpers/io_spec.rb
|
145
|
+
- spec/helpers/ruby_exe_spec.rb
|
142
146
|
- spec/helpers/scratch_spec.rb
|
143
147
|
- spec/helpers/tmp_spec.rb
|
144
148
|
- spec/matchers/base_spec.rb
|
@@ -165,6 +169,7 @@ files:
|
|
165
169
|
- spec/runner/actions/filter_spec.rb
|
166
170
|
- spec/runner/actions/gdb_spec.rb
|
167
171
|
- spec/runner/actions/tag_spec.rb
|
172
|
+
- spec/runner/actions/taglist_spec.rb
|
168
173
|
- spec/runner/actions/tally_spec.rb
|
169
174
|
- spec/runner/actions/timer_spec.rb
|
170
175
|
- spec/runner/context_spec.rb
|