mspec 1.5.17 → 1.5.18
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +27 -0
- data/Gemfile +4 -0
- data/README +39 -159
- data/Rakefile +4 -44
- data/bin/mkspec.bat +1 -0
- data/bin/mspec-ci.bat +1 -0
- data/bin/mspec-run.bat +1 -0
- data/bin/mspec-tag.bat +1 -0
- data/bin/mspec.bat +1 -0
- data/lib/mspec/commands/mkspec.rb +2 -2
- data/lib/mspec/commands/mspec-run.rb +4 -0
- data/lib/mspec/commands/mspec.rb +18 -3
- data/lib/mspec/guards.rb +1 -0
- data/lib/mspec/guards/block_device.rb +22 -0
- data/lib/mspec/guards/guard.rb +14 -2
- data/lib/mspec/helpers.rb +5 -5
- data/lib/mspec/helpers/const_lookup.rb +6 -1
- data/lib/mspec/helpers/datetime.rb +28 -0
- data/lib/mspec/helpers/ducktype.rb +4 -4
- data/lib/mspec/helpers/environment.rb +19 -2
- data/lib/mspec/helpers/fs.rb +5 -1
- data/lib/mspec/helpers/io.rb +39 -1
- data/lib/mspec/helpers/numeric.rb +89 -0
- data/lib/mspec/helpers/pack.rb +3 -0
- data/lib/mspec/helpers/ruby_exe.rb +53 -15
- data/lib/mspec/helpers/singleton_class.rb +7 -0
- data/lib/mspec/helpers/stasy.rb +33 -0
- data/lib/mspec/helpers/tmp.rb +16 -3
- data/lib/mspec/matchers.rb +8 -0
- data/lib/mspec/matchers/be_computed_by.rb +37 -0
- data/lib/mspec/matchers/be_computed_by_function.rb +35 -0
- data/lib/mspec/matchers/be_nan.rb +20 -0
- data/lib/mspec/matchers/be_valid_dns_name.rb +25 -0
- data/lib/mspec/matchers/have_data.rb +6 -5
- data/lib/mspec/matchers/have_private_method.rb +24 -0
- data/lib/mspec/matchers/have_singleton_method.rb +24 -0
- data/lib/mspec/matchers/infinity.rb +28 -0
- data/lib/mspec/matchers/match_yaml.rb +5 -5
- data/lib/mspec/matchers/raise_error.rb +5 -3
- data/lib/mspec/matchers/signed_zero.rb +28 -0
- data/lib/mspec/mocks/mock.rb +15 -9
- data/lib/mspec/mocks/object.rb +4 -0
- data/lib/mspec/mocks/proxy.rb +26 -1
- data/lib/mspec/runner/actions.rb +0 -1
- data/lib/mspec/runner/context.rb +18 -16
- data/lib/mspec/runner/formatters.rb +2 -0
- data/lib/mspec/runner/formatters/dotted.rb +13 -1
- data/lib/mspec/runner/formatters/junit.rb +96 -0
- data/lib/mspec/runner/formatters/profile.rb +70 -0
- data/lib/mspec/runner/mspec.rb +11 -0
- data/lib/mspec/runner/shared.rb +1 -1
- data/lib/mspec/utils/options.rb +33 -9
- data/lib/mspec/utils/ruby_name.rb +1 -1
- data/lib/mspec/utils/script.rb +2 -1
- data/lib/mspec/version.rb +1 -1
- data/mspec.gemspec +40 -0
- data/spec/commands/mkspec_spec.rb +4 -3
- data/spec/commands/mspec_ci_spec.rb +1 -6
- data/spec/commands/mspec_run_spec.rb +1 -6
- data/spec/commands/mspec_spec.rb +14 -6
- data/spec/commands/mspec_tag_spec.rb +28 -27
- data/spec/expectations/expectations_spec.rb +1 -1
- data/spec/expectations/should_spec.rb +4 -4
- data/spec/guards/background_spec.rb +2 -2
- data/spec/guards/block_device_spec.rb +46 -0
- data/spec/guards/bug_spec.rb +2 -3
- data/spec/guards/compliance_spec.rb +2 -2
- data/spec/guards/conflict_spec.rb +2 -2
- data/spec/guards/endian_spec.rb +2 -2
- data/spec/guards/extensions_spec.rb +2 -2
- data/spec/guards/feature_spec.rb +2 -2
- data/spec/guards/guard_spec.rb +80 -22
- data/spec/guards/noncompliance_spec.rb +2 -2
- data/spec/guards/platform_spec.rb +2 -2
- data/spec/guards/quarantine_spec.rb +2 -2
- data/spec/guards/runner_spec.rb +2 -2
- data/spec/guards/specified_spec.rb +2 -2
- data/spec/guards/superuser_spec.rb +2 -2
- data/spec/guards/support_spec.rb +2 -2
- data/spec/guards/tty_spec.rb +2 -2
- data/spec/guards/user_spec.rb +2 -2
- data/spec/guards/version_spec.rb +2 -2
- data/spec/helpers/argv_spec.rb +3 -2
- data/spec/helpers/const_lookup_spec.rb +3 -2
- data/spec/helpers/datetime_spec.rb +44 -0
- data/spec/helpers/ducktype_spec.rb +3 -2
- data/spec/helpers/encode_spec.rb +3 -2
- data/spec/helpers/enumerator_class_spec.rb +5 -5
- data/spec/helpers/environment_spec.rb +15 -3
- data/spec/helpers/fixture_spec.rb +3 -2
- data/spec/helpers/flunk_spec.rb +4 -3
- data/spec/helpers/fs_spec.rb +35 -18
- data/spec/helpers/hash_spec.rb +3 -2
- data/spec/helpers/io_spec.rb +75 -6
- data/spec/helpers/language_version_spec.rb +3 -2
- data/spec/helpers/mock_to_path_spec.rb +3 -2
- data/spec/helpers/numeric_spec.rb +25 -0
- data/spec/helpers/ruby_exe_spec.rb +115 -29
- data/spec/helpers/scratch_spec.rb +3 -1
- data/spec/helpers/stasy_spec.rb +59 -0
- data/spec/helpers/tmp_spec.rb +21 -4
- data/spec/matchers/base_spec.rb +2 -2
- data/spec/matchers/be_an_instance_of_spec.rb +2 -2
- data/spec/matchers/be_ancestor_of_spec.rb +2 -2
- data/spec/matchers/be_close_spec.rb +2 -2
- data/spec/matchers/be_computed_by_function_spec.rb +36 -0
- data/spec/matchers/be_computed_by_spec.rb +42 -0
- data/spec/matchers/be_empty_spec.rb +2 -2
- data/spec/matchers/be_false_spec.rb +3 -3
- data/spec/matchers/be_kind_of_spec.rb +2 -2
- data/spec/matchers/be_nan_spec.rb +28 -0
- data/spec/matchers/be_nil_spec.rb +3 -3
- data/spec/matchers/be_true_spec.rb +3 -3
- data/spec/matchers/be_valid_dns_name_spec.rb +50 -0
- data/spec/matchers/complain_spec.rb +2 -2
- data/spec/matchers/eql_spec.rb +2 -2
- data/spec/matchers/equal_element_spec.rb +2 -2
- data/spec/matchers/equal_spec.rb +2 -2
- data/spec/matchers/equal_utf16_spec.rb +2 -2
- data/spec/matchers/have_class_variable_spec.rb +3 -3
- data/spec/matchers/have_constant_spec.rb +2 -2
- data/spec/matchers/have_data_spec.rb +8 -5
- data/spec/matchers/have_instance_method_spec.rb +2 -2
- data/spec/matchers/have_instance_variable_spec.rb +3 -3
- data/spec/matchers/have_method_spec.rb +2 -2
- data/spec/matchers/have_private_instance_method_spec.rb +3 -3
- data/spec/matchers/have_private_method_spec.rb +44 -0
- data/spec/matchers/have_protected_instance_method_spec.rb +2 -2
- data/spec/matchers/have_public_instance_method_spec.rb +2 -2
- data/spec/matchers/have_singleton_method_spec.rb +45 -0
- data/spec/matchers/include_spec.rb +2 -2
- data/spec/matchers/infinity_spec.rb +34 -0
- data/spec/matchers/match_yaml_spec.rb +3 -3
- data/spec/matchers/output_spec.rb +2 -2
- data/spec/matchers/output_to_fd_spec.rb +2 -2
- data/spec/matchers/raise_error_spec.rb +24 -3
- data/spec/matchers/respond_to_spec.rb +2 -2
- data/spec/matchers/signed_zero_spec.rb +32 -0
- data/spec/matchers/stringsymboladapter_spec.rb +2 -2
- data/spec/mocks/mock_spec.rb +12 -12
- data/spec/mocks/proxy_spec.rb +1 -1
- data/spec/runner/actions/gdb_spec.rb +1 -1
- data/spec/runner/actions/tag_spec.rb +1 -1
- data/spec/runner/actions/taglist_spec.rb +1 -1
- data/spec/runner/context_spec.rb +27 -27
- data/spec/runner/example_spec.rb +1 -1
- data/spec/runner/exception_spec.rb +1 -1
- data/spec/runner/filters/tag_spec.rb +2 -2
- data/spec/runner/formatters/describe_spec.rb +1 -1
- data/spec/runner/formatters/dotted_spec.rb +2 -2
- data/spec/runner/formatters/html_spec.rb +2 -2
- data/spec/runner/formatters/junit_spec.rb +147 -0
- data/spec/runner/formatters/unit_spec.rb +2 -2
- data/spec/runner/formatters/yaml_spec.rb +3 -3
- data/spec/runner/mspec_spec.rb +22 -21
- data/spec/runner/shared_spec.rb +9 -1
- data/spec/runner/tag_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -7
- data/spec/utils/name_map_spec.rb +1 -2
- data/spec/utils/options_spec.rb +58 -27
- data/spec/utils/script_spec.rb +5 -13
- data/spec/utils/version_spec.rb +1 -1
- metadata +254 -64
- data/lib/mspec/helpers/bignum.rb +0 -5
- data/lib/mspec/helpers/fmode.rb +0 -15
- data/lib/mspec/helpers/infinity.rb +0 -5
- data/lib/mspec/helpers/metaclass.rb +0 -7
- data/lib/mspec/helpers/nan.rb +0 -5
- data/lib/mspec/runner/actions/debug.rb +0 -17
- data/spec/helpers/bignum_spec.rb +0 -11
- data/spec/helpers/fmode_spec.rb +0 -14
- data/spec/helpers/infinity_spec.rb +0 -8
- data/spec/helpers/nan_spec.rb +0 -8
- data/spec/runner/actions/debug_spec.rb +0 -62
data/lib/mspec/helpers/bignum.rb
DELETED
data/lib/mspec/helpers/fmode.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'mspec/guards/feature'
|
2
|
-
|
3
|
-
class Object
|
4
|
-
# This helper simplifies passing file access modes regardless of
|
5
|
-
# whether the :encoding feature is enabled. Only the access specifier
|
6
|
-
# itself will be returned if :encoding is not enabled. Otherwise,
|
7
|
-
# the full mode string will be returned (i.e. the helper is a no-op).
|
8
|
-
def fmode(mode)
|
9
|
-
if FeatureGuard.enabled? :encoding
|
10
|
-
mode
|
11
|
-
else
|
12
|
-
mode.split(':').first
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/lib/mspec/helpers/nan.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'mspec/runner/actions/filter'
|
2
|
-
|
3
|
-
class DebugAction < ActionFilter
|
4
|
-
def before(state)
|
5
|
-
Kernel.debugger if self === state.description
|
6
|
-
end
|
7
|
-
|
8
|
-
def register
|
9
|
-
super
|
10
|
-
MSpec.register :before, self
|
11
|
-
end
|
12
|
-
|
13
|
-
def unregister
|
14
|
-
super
|
15
|
-
MSpec.unregister :before, self
|
16
|
-
end
|
17
|
-
end
|
data/spec/helpers/bignum_spec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
require 'mspec/helpers/bignum'
|
3
|
-
|
4
|
-
describe Object, "#bignum_value" do
|
5
|
-
it "returns a value that is an instance of Bignum on any platform" do
|
6
|
-
bignum_value.should == 0x8000_0000_0000_0000
|
7
|
-
end
|
8
|
-
|
9
|
-
it "returns the default value incremented by the argument" do
|
10
|
-
end
|
11
|
-
end
|
data/spec/helpers/fmode_spec.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
require 'mspec/helpers/fmode'
|
3
|
-
|
4
|
-
describe Object, "#fmode" do
|
5
|
-
it "returns the argument unmodified if :encoding feature is enabled" do
|
6
|
-
FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true)
|
7
|
-
fmode("rb:binary:utf-8").should == "rb:binary:utf-8"
|
8
|
-
end
|
9
|
-
|
10
|
-
it "returns only the file access mode if :encoding feature is not enabled" do
|
11
|
-
FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(false)
|
12
|
-
fmode("rb:binary:utf-8").should == "rb"
|
13
|
-
end
|
14
|
-
end
|
data/spec/helpers/nan_spec.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require 'mspec/runner/actions/debug'
|
3
|
-
require 'mspec/runner/mspec'
|
4
|
-
require 'mspec/runner/context'
|
5
|
-
require 'mspec/runner/example'
|
6
|
-
|
7
|
-
describe DebugAction do
|
8
|
-
before :each do
|
9
|
-
MSpec.stub!(:read_tags).and_return([])
|
10
|
-
end
|
11
|
-
|
12
|
-
it "creates an MatchFilter with its tag and desc arguments" do
|
13
|
-
filter = mock('action filter', :null_object => true)
|
14
|
-
MatchFilter.should_receive(:new).with(nil, "some", "thing").and_return(filter)
|
15
|
-
DebugAction.new ["tag", "key"], ["some", "thing"]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe DebugAction, "#before" do
|
20
|
-
before :each do
|
21
|
-
MSpec.stub!(:read_tags).and_return([])
|
22
|
-
@state = ExampleState.new ContextState.new("Catch#me"), "if you can"
|
23
|
-
end
|
24
|
-
|
25
|
-
it "does not invoke the debugger if the description does not match" do
|
26
|
-
Kernel.should_not_receive(:debugger)
|
27
|
-
action = DebugAction.new nil, "match"
|
28
|
-
action.before @state
|
29
|
-
end
|
30
|
-
|
31
|
-
it "invokes the debugger if the description matches" do
|
32
|
-
Kernel.should_receive(:debugger)
|
33
|
-
action = DebugAction.new nil, "can"
|
34
|
-
action.before @state
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe DebugAction, "#register" do
|
39
|
-
before :each do
|
40
|
-
MSpec.stub!(:read_tags).and_return([])
|
41
|
-
MSpec.stub!(:register)
|
42
|
-
@action = DebugAction.new nil, nil
|
43
|
-
end
|
44
|
-
|
45
|
-
it "registers itself with MSpec for the :before action" do
|
46
|
-
MSpec.should_receive(:register).with(:before, @action)
|
47
|
-
@action.register
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe DebugAction, "#unregister" do
|
52
|
-
before :each do
|
53
|
-
MSpec.stub!(:read_tags).and_return([])
|
54
|
-
MSpec.stub!(:unregister)
|
55
|
-
@action = DebugAction.new nil, nil
|
56
|
-
end
|
57
|
-
|
58
|
-
it "unregisters itself with MSpec for the :before action" do
|
59
|
-
MSpec.should_receive(:unregister).with(:before, @action)
|
60
|
-
@action.unregister
|
61
|
-
end
|
62
|
-
end
|