ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
PK P]CA Mock/cdesc-Mock.rinu [ U:RDoc::NormalClass[iI" Mock:ETI"MiniTest::Mock;TI"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"-All mock objects are an instance of Mock;T:
@fileI"lib/minitest/mock.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[ [I"
instance;T[[;[[I"expect;FI"lib/minitest/mock.rb;T[I"verify;F@&[;
[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@I"
MiniTest;FcRDoc::NormalModulePK P]MHe Mock/expect-i.rinu [ U:RDoc::AnyMethod[iI"expect:EFI"MiniTest::Mock#expect;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FExpect that method +name+ is called, optionally with +args+ or a ;TI"!+blk+, and returns +retval+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"(@mock.expect(:meaning_of_life, 42)
;TI"#@mock.meaning_of_life # => 42
;TI"
;TI">@mock.expect(:do_something_with, true, [some_obj, true])
;TI"7@mock.do_something_with(some_obj, true) # => true
;TI"
;TI"8@mock.expect(:do_something_else, true) do |a1, a2|
;TI"% a1 == "buggs" && a2 == :bunny
;TI" end
;T:@format0o;
; [I"J+args+ is compared to the expected args using case equality (ie, the ;TI">'===' operator), allowing for less specific expectations.;T@o;; [I"4@mock.expect(:uses_any_string, true, [String])
;TI",@mock.uses_any_string("foo") # => true
;TI"@mock.verify # => true
;TI"
;TI"2@mock.expect(:uses_one_string, true, ["foo"]
;TI",@mock.uses_one_string("bar") # => true
;TI"3@mock.verify # => raises MockExpectationError;T;
0:
@fileI"lib/minitest/mock.rb;T:0@omit_headings_from_table_of_contents_below000[ I""(name, retval, args=[], &blk);T@(FI" Mock;TcRDoc::NormalClass00PK P]GTǠ Mock/verify-i.rinu [ U:RDoc::AnyMethod[iI"verify:EFI"MiniTest::Mock#verify;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Verify that all methods were called as expected. Raises ;TI"A+MockExpectationError+ if the mock object was not called as ;TI"expected.;T:
@fileI"lib/minitest/mock.rb;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI" Mock;TcRDoc::NormalClass00PK P]gv2 Assertion/cdesc-Assertion.rinu [ U:RDoc::NormalClass[iI"Assertion:ETI"MiniTest::Assertion;TI"Exception;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"Assertion base class;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[ [I"
instance;T[[;[ [;
[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@I"
MiniTest;FcRDoc::NormalModulePK P](D Skip/cdesc-Skip.rinu [ U:RDoc::NormalClass[iI" Skip:ETI"MiniTest::Skip;TI"MiniTest::Assertion;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"*Assertion raised when skipping a test;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[ [I"
instance;T[[;[ [;
[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@I"
MiniTest;FcRDoc::NormalModulePK P]R_ _ ! Assertions/exception_details-i.rinu [ U:RDoc::AnyMethod[iI"exception_details:EFI"+MiniTest::Assertions#exception_details;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"&Returns details for exception +e+;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(e, msg);T@FI"Assertions;FcRDoc::NormalModule00PK P]Dl l Assertions/synchronize-i.rinu [ U:RDoc::AnyMethod[iI"synchronize:EFI"%MiniTest::Assertions#synchronize;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Takes a block and wraps it with the runner's shared mutex.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P]՞9 9 Assertions/flunk-i.rinu [ U:RDoc::AnyMethod[iI"
flunk:EFI"MiniTest::Assertions#flunk;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Fails with +msg+;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]}g g Assertions/cdesc-Assertions.rinu [ U:RDoc::NormalModule[iI"Assertions:EFI"MiniTest::Assertions;T0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"IMiniTest Assertions. All assertion methods accept a +msg+ which is ;TI"$printed if the assertion fails.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[[I" diff;FI"lib/minitest/unit.rb;T[I"
diff=;F@[:protected[ [:private[ [I"
instance;T[[;[2[I"assert;F@[I"assert_empty;F@[I"assert_equal;F@[I"assert_in_delta;F@[I"assert_in_epsilon;F@[I"assert_includes;F@[I"assert_instance_of;F@[I"assert_kind_of;F@[I"assert_match;F@[I"assert_nil;F@[I"assert_operator;F@[I"assert_output;F@[I"assert_predicate;F@[I"assert_raises;F@[I"assert_respond_to;F@[I"assert_same;F@[I"assert_send;F@[I"assert_silent;F@[I"assert_throws;F@[I"capture_io;F@[I"capture_subprocess_io;F@[I" diff;F@[I"exception_details;F@[I"
flunk;F@[I"message;F@[I"
mu_pp;F@[I"mu_pp_for_diff;F@[I" pass;F@[I"refute;F@[I"refute_empty;F@[I"refute_equal;F@[I"refute_in_delta;F@[I"refute_in_epsilon;F@[I"refute_includes;F@[I"refute_instance_of;F@[I"refute_kind_of;F@[I"refute_match;F@[I"refute_nil;F@[I"refute_operator;F@[I"refute_predicate;F@[I"refute_respond_to;F@[I"refute_same;F@[I" skip;F@[I"
skipped?;F@[I"synchronize;F@[;
[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@I"
MiniTest;FcRDoc::NormalModulePK P]H ! Assertions/refute_in_epsilon-i.rinu [ U:RDoc::AnyMethod[iI"refute_in_epsilon:EFI"+MiniTest::Assertions#refute_in_epsilon;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"KFor comparing Floats. Fails if +exp+ and +act+ have a relative error ;TI"less than +epsilon+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"'(a, b, epsilon = 0.001, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]
x x Assertions/refute_same-i.rinu [ U:RDoc::AnyMethod[iI"refute_same:EFI"%MiniTest::Assertions#refute_same;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">Fails if +exp+ is the same (by object identity) as +act+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(exp, act, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]dr r ! Assertions/assert_respond_to-i.rinu [ U:RDoc::AnyMethod[iI"assert_respond_to:EFI"+MiniTest::Assertions#assert_respond_to;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Fails unless +obj+ responds to +meth+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, meth, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]Y Assertions/assert_equal-i.rinu [ U:RDoc::AnyMethod[iI"assert_equal:EFI"&MiniTest::Assertions#assert_equal;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FFails unless exp == act printing the difference between ;TI"the two, if possible.;To:RDoc::Markup::BlankLine o;
; [I"DIf there is no visible difference but the assertion fails, you ;TI"Fshould suspect that your #== is buggy, or your inspect output is ;TI"missing crucial details.;T@o;
; [I"$For floats use assert_in_delta.;T@o;
; [I"(See also: MiniTest::Assertions.diff;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(exp, act, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]k6U U Assertions/assert-i.rinu [ U:RDoc::AnyMethod[iI"assert:EFI" MiniTest::Assertions#assert;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I")Fails unless +test+ is a true value.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(test, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]@ Assertions/assert_raises-i.rinu [ U:RDoc::AnyMethod[iI"assert_raises:EFI"'MiniTest::Assertions#assert_raises;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Fails unless the block raises one of +exp+. Returns the ;TI"Eexception matched so you can check the message, attributes, etc.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"(*exp);T@FI"Assertions;FcRDoc::NormalModule00PK P]xb, Assertions/assert_send-i.rinu [ U:RDoc::AnyMethod[iI"assert_send:EFI"%MiniTest::Assertions#assert_send;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"5+send_ary+ is a receiver, message and arguments.;To:RDoc::Markup::BlankLine o;
; [I"0Fails unless the call returns a true value ;TI"1TODO: I should prolly remove this from specs;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(send_ary, m = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]n߉S( ( Assertions/assert_in_delta-i.rinu [ U:RDoc::AnyMethod[iI"assert_in_delta:EFI")MiniTest::Assertions#assert_in_delta;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LFor comparing Floats. Fails unless +exp+ and +act+ are within +delta+ ;TI"of each other.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"1assert_in_delta Math::PI, (22.0 / 7.0), 0.01;T:@format0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I")(exp, act, delta = 0.001, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]dq, Assertions/refute_equal-i.rinu [ U:RDoc::AnyMethod[iI"refute_equal:EFI"&MiniTest::Assertions#refute_equal;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I""Fails if exp == act.;To:RDoc::Markup::BlankLine o;
; [I"$For floats use refute_in_delta.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(exp, act, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]R]g g Assertions/refute_kind_of-i.rinu [ U:RDoc::AnyMethod[iI"refute_kind_of:EFI"(MiniTest::Assertions#refute_kind_of;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"'Fails if +obj+ is a kind of +cls+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(cls, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]T T Assertions/refute_empty-i.rinu [ U:RDoc::AnyMethod[iI"refute_empty:EFI"&MiniTest::Assertions#refute_empty;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Fails if +obj+ is empty.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]ݣ7 7 Assertions/mu_pp_for_diff-i.rinu [ U:RDoc::AnyMethod[iI"mu_pp_for_diff:EFI"(MiniTest::Assertions#mu_pp_for_diff;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"DThis returns a diff-able human-readable version of +obj+. This ;TI"?differs from the regular mu_pp because it expands escaped ;TI"Cnewlines and makes hex-values generic (like object_ids). This ;TI";uses mu_pp to do the first pass and then cleans it up.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(obj);T@FI"Assertions;FcRDoc::NormalModule00PK P]ǿRl Assertions/refute_operator-i.rinu [ U:RDoc::AnyMethod[iI"refute_operator:EFI")MiniTest::Assertions#refute_operator;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(Fails if +o1+ is not +op+ +o2+. Eg:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"'refute_operator 1, :>, 2 #=> pass
;TI"&refute_operator 1, :<, 2 #=> fail;T:@format0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"((o1, op, o2 = UNDEFINED, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]51Q Q Assertions/assert_nil-i.rinu [ U:RDoc::AnyMethod[iI"assert_nil:EFI"$MiniTest::Assertions#assert_nil;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Fails unless +obj+ is nil;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]|F F Assertions/assert_predicate-i.rinu [ U:RDoc::AnyMethod[iI"assert_predicate:EFI"*MiniTest::Assertions#assert_predicate;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"!For testing with predicates.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"#assert_predicate str, :empty?
;T:@format0o;
; [I"JThis is really meant for specs and is front-ended by assert_operator:;T@o;; [I"str.must_be :empty?;T;
0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(o1, op, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]xcg g Assertions/assert_same-i.rinu [ U:RDoc::AnyMethod[iI"assert_same:EFI"%MiniTest::Assertions#assert_same;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"-Fails unless +exp+ and +act+ are #equal?;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(exp, act, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P] Assertions/assert_output-i.rinu [ U:RDoc::AnyMethod[iI"assert_output:EFI"'MiniTest::Assertions#assert_output;TF:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [ I"CFails if stdout or stderr do not output the expected results. ;TI"FPass in nil if you don't care about that streams output. Pass in ;TI"E"" if you require it to be silent. Pass in a regexp if you want ;TI"to pattern match.;To:RDoc::Markup::BlankLine o;
; [I"=NOTE: this uses #capture_io, not #capture_subprocess_io.;T@o;
; [I"See also: #assert_silent;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"!(stdout = nil, stderr = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]KF F Assertions/refute_predicate-i.rinu [ U:RDoc::AnyMethod[iI"refute_predicate:EFI"*MiniTest::Assertions#refute_predicate;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"!For testing with predicates.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"#refute_predicate str, :empty?
;T:@format0o;
; [I"JThis is really meant for specs and is front-ended by refute_operator:;T@o;; [I"str.wont_be :empty?;T;
0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(o1, op, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P] Assertions/diff-c.rinu [ U:RDoc::AnyMethod[iI" diff:EFI"MiniTest::Assertions::diff;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FReturns the diff command to use in #diff. Tries to intelligently ;TI"!figure out what diff to use.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P]}|+g g Assertions/assert_throws-i.rinu [ U:RDoc::AnyMethod[iI"assert_throws:EFI"'MiniTest::Assertions#assert_throws;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(Fails unless the block throws +sym+;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"(sym, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]- ! Assertions/assert_in_epsilon-i.rinu [ U:RDoc::AnyMethod[iI"assert_in_epsilon:EFI"+MiniTest::Assertions#assert_in_epsilon;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"IFor comparing Floats. Fails unless +exp+ and +act+ have a relative ;TI"error less than +epsilon+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"'(a, b, epsilon = 0.001, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]Ʃn n Assertions/assert_match-i.rinu [ U:RDoc::AnyMethod[iI"assert_match:EFI"&MiniTest::Assertions#assert_match;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Fails unless +matcher+ =~ +obj+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(matcher, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]| Assertions/capture_io-i.rinu [ U:RDoc::AnyMethod[iI"capture_io:EFI"$MiniTest::Assertions#capture_io;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"/Captures $stdout and $stderr into strings:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"out, err = capture_io do
;TI" puts "Some info"
;TI"" warn "You did a bad thing"
;TI" end
;TI"
;TI" assert_match %r%info%, out
;TI"assert_match %r%bad%, err
;T:@format0o;
; [I"BNOTE: For efficiency, this method uses StringIO and does not ;TI"Acapture IO for subprocesses. Use #capture_subprocess_io for ;TI"
that.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P]#9iX X Assertions/assert_empty-i.rinu [ U:RDoc::AnyMethod[iI"assert_empty:EFI"&MiniTest::Assertions#assert_empty;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"!Fails unless +obj+ is empty.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]j j Assertions/refute_match-i.rinu [ U:RDoc::AnyMethod[iI"refute_match:EFI"&MiniTest::Assertions#refute_match;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Fails if +matcher+ =~ +obj+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(matcher, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P] Assertions/diff-i.rinu [ U:RDoc::AnyMethod[iI" diff:EFI"MiniTest::Assertions#diff;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"BReturns a diff between +exp+ and +act+. If there is no known ;TI"Adiff command or if it doesn't make sense to diff the output ;TI"A(single line, short output), then it simply returns a basic ;TI" comparison between the two.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(exp, act);T@FI"Assertions;FcRDoc::NormalModule00PK P]wV Assertions/message-i.rinu [ U:RDoc::AnyMethod[iI"message:EFI"!MiniTest::Assertions#message;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"JReturns a proc that will output +msg+ along with the default message.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"((msg = nil, ending = ".", &default);T@FI"Assertions;FcRDoc::NormalModule00PK P]H_b b % Assertions/capture_subprocess_io-i.rinu [ U:RDoc::AnyMethod[iI"capture_subprocess_io:EFI"/MiniTest::Assertions#capture_subprocess_io;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"BCaptures $stdout and $stderr into strings, using Tempfile to ;TI"3ensure that subprocess IO is captured as well.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I")out, err = capture_subprocess_io do
;TI" system "echo Some info"
;TI". system "echo You did a bad thing 1>&2"
;TI" end
;TI"
;TI" assert_match %r%info%, out
;TI"assert_match %r%bad%, err
;T:@format0o;
; [I"GNOTE: This method is approximately 10x slower than #capture_io so ;TI"Bonly use it when you need to test the output of a subprocess.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P]{ȷ Assertions/skip-i.rinu [ U:RDoc::AnyMethod[iI" skip:EFI"MiniTest::Assertions#skip;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"CSkips the current test. Gets listed at the end of the run but ;TI"'doesn't cause a failure exit code.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(msg = nil, bt = caller);T@FI"Assertions;FcRDoc::NormalModule00PK P]檐k k Assertions/assert_kind_of-i.rinu [ U:RDoc::AnyMethod[iI"assert_kind_of:EFI"(MiniTest::Assertions#assert_kind_of;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Fails unless +obj+ is a kind of +cls+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(cls, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]1x x " Assertions/assert_instance_of-i.rinu [ U:RDoc::AnyMethod[iI"assert_instance_of:EFI",MiniTest::Assertions#assert_instance_of;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"0Fails unless +obj+ is an instance of +cls+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(cls, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]8f Assertions/assert_operator-i.rinu [ U:RDoc::AnyMethod[iI"assert_operator:EFI")MiniTest::Assertions#assert_operator;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"'For testing with binary operators.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"assert_operator 5, :<=, 4;T:@format0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"((o1, op, o2 = UNDEFINED, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]I!w w Assertions/assert_includes-i.rinu [ U:RDoc::AnyMethod[iI"assert_includes:EFI")MiniTest::Assertions#assert_includes;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Fails unless +collection+ includes +obj+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"!(collection, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]t t " Assertions/refute_instance_of-i.rinu [ U:RDoc::AnyMethod[iI"refute_instance_of:EFI",MiniTest::Assertions#refute_instance_of;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I",Fails if +obj+ is an instance of +cls+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(cls, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]C' Assertions/refute_in_delta-i.rinu [ U:RDoc::AnyMethod[iI"refute_in_delta:EFI")MiniTest::Assertions#refute_in_delta;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FFor comparing Floats. Fails if +exp+ is within +delta+ of +act+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"+refute_in_delta Math::PI, (22.0 / 7.0);T:@format0:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I")(exp, act, delta = 0.001, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]>wY Assertions/mu_pp-i.rinu [ U:RDoc::AnyMethod[iI"
mu_pp:EFI"MiniTest::Assertions#mu_pp;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"@This returns a human-readable version of +obj+. By default ;TI"D#inspect is called. You can override this to use #pretty_print ;TI"if you want.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(obj);T@FI"Assertions;FcRDoc::NormalModule00PK P]똻C C Assertions/pass-i.rinu [ U:RDoc::AnyMethod[iI" pass:EFI"MiniTest::Assertions#pass;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"!used for counting assertions;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]~rN N Assertions/refute_nil-i.rinu [ U:RDoc::AnyMethod[iI"refute_nil:EFI"$MiniTest::Assertions#refute_nil;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Fails if +obj+ is nil.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]U U Assertions/skipped%3f-i.rinu [ U:RDoc::AnyMethod[iI"
skipped?:EFI""MiniTest::Assertions#skipped?;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"4Was this testcase skipped? Meant for #teardown.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P](z z ! Assertions/refute_respond_to-i.rinu [ U:RDoc::AnyMethod[iI"refute_respond_to:EFI"+MiniTest::Assertions#refute_respond_to;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"3Fails if +obj+ responds to the message +meth+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(obj, meth, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]?o Assertions/assert_silent-i.rinu [ U:RDoc::AnyMethod[iI"assert_silent:EFI"'MiniTest::Assertions#assert_silent;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Fails if the block outputs anything to stderr or stdout.;To:RDoc::Markup::BlankLine o;
; [I"See also: #assert_output;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below00I" ;T[ I"();T@FI"Assertions;FcRDoc::NormalModule00PK P]WJP P Assertions/refute-i.rinu [ U:RDoc::AnyMethod[iI"refute:EFI" MiniTest::Assertions#refute;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"$Fails if +test+ is a true value;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(test, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]oG G Assertions/diff%3d-c.rinu [ U:RDoc::AnyMethod[iI"
diff=:EFI" MiniTest::Assertions::diff=;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Set the diff command to use in #diff.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(o);T@FI"Assertions;FcRDoc::NormalModule00PK P]xs s Assertions/refute_includes-i.rinu [ U:RDoc::AnyMethod[iI"refute_includes:EFI")MiniTest::Assertions#refute_includes;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Fails if +collection+ includes +obj+.;T:
@fileI"lib/minitest/unit.rb;T:0@omit_headings_from_table_of_contents_below000[ I"!(collection, obj, msg = nil);T@FI"Assertions;FcRDoc::NormalModule00PK P]ȎM M cdesc-MiniTest.rinu [ U:RDoc::NormalModule[iI"
MiniTest:EF@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"8Minimal (mostly drop-in) replacement for test-unit.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading:
leveli: textI"(minitest/{unit,spec,mock,benchmark};T@o:RDoc::Markup::List:
@type: NOTE:@items[o:RDoc::Markup::ListItem:@label[I"
home ;T;[o; ;[I"*https://github.com/seattlerb/minitest;To;;[I"
rdoc ;T;[o; ;[I"'http://docs.seattlerb.org/minitest;To;;[I"
vim ;T;[o; ;[I"0https://github.com/sunaku/vim-ruby-minitest;T@S;;i;
I"DESCRIPTION:;T@o; ;[I"Iminitest provides a complete suite of testing facilities supporting ;TI")TDD, BDD, mocking, and benchmarking.;T@o:RDoc::Markup::Verbatim;[I"F"I had a class with Jim Weirich on testing last week and we were
;TI"G allowed to choose our testing frameworks. Kirk Haines and I were
;TI"< paired up and we cracked open the code for a few test
;TI" frameworks...
;TI"
;TI"C I MUST say that minitest is *very* readable / understandable
;TI"H compared to the 'other two' options we looked at. Nicely done and
;TI"8 thank you for helping us keep our mental sanity."
;TI"
;TI"-- Wayne E. Seguin
;T:@format0o; ;[I"Jminitest/unit is a small and incredibly fast unit testing framework. ;TI"GIt provides a rich set of assertions to make your tests clean and ;TI"readable.;T@o; ;[I"Iminitest/spec is a functionally complete spec engine. It hooks onto ;TI"Gminitest/unit and seamlessly bridges test assertions over to spec ;TI"expectations.;T@o; ;[ I"Lminitest/benchmark is an awesome way to assert the performance of your ;TI"Jalgorithms in a repeatable manner. Now you can assert that your newb ;TI"Ico-worker doesn't replace your linear algorithm with an exponential ;TI" one!;T@o; ;[I"Jminitest/mock by Steven Baker, is a beautifully tiny mock (and stub) ;TI"object framework.;T@o; ;[I"Jminitest/pride shows pride in testing and adds coloring to your test ;TI"Foutput. I guess it is an example of how to write IO pipes too. :P;T@o; ;[ I"Hminitest/unit is meant to have a clean implementation for language ;TI"Limplementors that need a minimal set of methods to bootstrap a working ;TI"Gtest suite. For example, there is no magic involved for test-case ;TI"discovery.;T@o;;[ I"A"Again, I can't praise enough the idea of a testing/specing
;TI"B framework that I can actually read in full in one sitting!"
;TI"
;TI"-- Piotr Szotkowski
;T;0o; ;[I"Comparing to rspec:;T@o;;[I"/rspec is a testing DSL. minitest is ruby.
;TI"
;TI",-- Adam Hawkins, "Bow Before MiniTest"
;T;0o; ;[ I"Jminitest doesn't reinvent anything that ruby already provides, like: ;TI"Iclasses, modules, inheritance, methods. This means you only have to ;TI"Jlearn ruby to use minitest and all of your regular OO practices like ;TI"-extract-method refactorings still apply.;T@S;;i;
I"FEATURES/PROBLEMS:;T@o;;:BULLET;[o;;0;[o; ;[I"Hminitest/autorun - the easy and explicit way to run all your tests.;To;;0;[o; ;[I"@minitest/unit - a very fast, simple, and clean test system.;To;;0;[o; ;[I"@minitest/spec - a very fast, simple, and clean spec system.;To;;0;[o; ;[I"9minitest/mock - a simple and clean mock/stub system.;To;;0;[o; ;[I"Pminitest/benchmark - an awesome way to assert your algorithm's performance.;To;;0;[o; ;[I"1minitest/pride - show your pride in testing!;To;;0;[o; ;[I"AIncredibly small and fast runner, but no bells and whistles.;T@S;;i;
I"RATIONALE:;T@o; ;[I"ISee design_rationale.rb to see how specs and tests work in minitest.;T@S;;i;
I"SYNOPSIS:;T@o; ;[I"7Given that you'd like to test the following class:;T@o;;[I"class Meme
;TI"" def i_can_has_cheezburger?
;TI" "OHAI!"
;TI" end
;TI"
;TI" def will_it_blend?
;TI" "YES!"
;TI" end
;TI" end
;T;0S;;i;
I"Unit tests;T@o;;[I" require 'minitest/autorun'
;TI"
;TI"/class TestMeme < MiniTest::Unit::TestCase
;TI" def setup
;TI" @meme = Meme.new
;TI" end
;TI"
;TI"# def test_that_kitty_can_eat
;TI"< assert_equal "OHAI!", @meme.i_can_has_cheezburger?
;TI" end
;TI"
;TI"' def test_that_it_will_not_blend
;TI"3 refute_match /^no/i, @meme.will_it_blend?
;TI" end
;TI"
;TI"% def test_that_will_be_skipped
;TI" skip "test this later"
;TI" end
;TI" end
;T;0S;;i;
I"
Specs;T@o;;[I" require 'minitest/autorun'
;TI"
;TI"describe Meme do
;TI" before do
;TI" @meme = Meme.new
;TI" end
;TI"
;TI"4 describe "when asked about cheeseburgers" do
;TI") it "must respond positively" do
;TI"; @meme.i_can_has_cheezburger?.must_equal "OHAI!"
;TI"
end
;TI" end
;TI"
;TI"= describe "when asked about blending possibilities" do
;TI" it "won't say no" do
;TI"2 @meme.will_it_blend?.wont_match /^no/i
;TI"
end
;TI" end
;TI" end
;T;0o; ;[I"$For matchers support check out:;T@o; ;[I"3https://github.com/zenspider/minitest-matchers;T@S;;i;
I"Benchmarks;T@o; ;[I"LAdd benchmarks to your regular unit tests. If the unit tests fail, the ;TI"benchmarks won't run.;T@o;;[I"9# optionally run benchmarks, good for CI-only work!
;TI"2require 'minitest/benchmark' if ENV["BENCH"]
;TI"
;TI"/class TestMeme < MiniTest::Unit::TestCase
;TI"S # Override self.bench_range or default range is [1, 10, 100, 1_000, 10_000]
;TI" def bench_my_algorithm
;TI"F assert_performance_linear 0.9999 do |n| # n is a range value
;TI" @obj.my_algorithm(n)
;TI"
end
;TI" end
;TI" end
;T;0o; ;[I"HOr add them to your specs. If you make benchmarks optional, you'll ;TI"Kneed to wrap your benchmarks in a conditional since the methods won't ;TI"be defined.;T@o;;[I"describe Meme do
;TI" if ENV["BENCH"] then
;TI"@ bench_performance_linear "my_algorithm", 0.9999 do |n|
;TI" 100.times do
;TI"" @obj.my_algorithm(n)
;TI" end
;TI"
end
;TI" end
;TI" end
;T;0o; ;[I"outputs something like:;T@o;;[
I"# Running benchmarks:
;TI"
;TI"'TestBlah 100 1000 10000
;TI"Cbench_my_algorithm 0.006167 0.079279 0.786993
;TI"Kbench_other_algorithm 0.061679 0.792797 7.869932
;T;0o; ;[I"IOutput is tab-delimited to make it easy to paste into a spreadsheet.;T@S;;i;
I"
Mocks;T@o;;["I"class MemeAsker
;TI" def initialize(meme)
;TI" @meme = meme
;TI" end
;TI"
;TI" def ask(question)
;TI"- method = question.tr(" ","_") + "?"
;TI" @meme.__send__(method)
;TI" end
;TI" end
;TI"
;TI" require 'minitest/autorun'
;TI"
;TI"describe MemeAsker do
;TI" before do
;TI"$ @meme = MiniTest::Mock.new
;TI"+ @meme_asker = MemeAsker.new @meme
;TI" end
;TI"
;TI" describe "#ask" do
;TI"< describe "when passed an unpunctuated question" do
;TI"N it "should invoke the appropriate predicate method on the meme" do
;TI"9 @meme.expect :will_it_blend?, :return_value
;TI"- @meme_asker.ask "will it blend"
;TI" @meme.verify
;TI" end
;TI"
end
;TI" end
;TI" end
;T;0S;;i;
I"
Stubs;T@o;;[I"def test_stale_eh
;TI"& obj_under_test = Something.new
;TI"
;TI"$ refute obj_under_test.stale?
;TI"
;TI"O Time.stub :now, Time.at(0) do # stub goes away once the block is done
;TI"& assert obj_under_test.stale?
;TI" end
;TI" end
;T;0o; ;[I"DA note on stubbing: In order to stub a method, the method must ;TI"Jactually exist prior to stubbing. Use a singleton method to create a ;TI"new non-existing method:;T@o;;[I"$def obj_under_test.fake_method
;TI" ...
;TI" end
;T;0S;;i;
I"$Customizable Test Runner Types:;T@o; ;[ I"LMiniTest::Unit.runner=(runner) provides an easy way of creating custom ;TI"Ctest runners for specialized needs. Justin Weiss provides the ;TI"Ffollowing real-world example to create an alternative to regular ;TI"fixture loading:;T@o;;[1I"4class MiniTestWithHooks::Unit < MiniTest::Unit
;TI" def before_suites
;TI" end
;TI"
;TI" def after_suites
;TI" end
;TI"
;TI"% def _run_suites(suites, type)
;TI" begin
;TI" before_suites
;TI" super(suites, type)
;TI" ensure
;TI" after_suites
;TI"
end
;TI" end
;TI"
;TI"# def _run_suite(suite, type)
;TI" begin
;TI" suite.before_suite
;TI" super(suite, type)
;TI" ensure
;TI" suite.after_suite
;TI"
end
;TI" end
;TI" end
;TI"
;TI"%module MiniTestWithTransactions
;TI", class Unit < MiniTestWithHooks::Unit
;TI"! include TestSetupHelper
;TI"
;TI" def before_suites
;TI" super
;TI"% setup_nested_transactions
;TI"; # load any data we want available for all tests
;TI"
end
;TI"
;TI" def after_suites
;TI"( teardown_nested_transactions
;TI" super
;TI"
end
;TI" end
;TI" end
;TI"
;TI"@MiniTest::Unit.runner = MiniTestWithTransactions::Unit.new
;T;0S;;i;
I"FAQ;T@S;;i;
I"!How to test SimpleDelegates?;T@o; ;[I"+The following implementation and test:;T@o;;[I"$class Worker < SimpleDelegator
;TI" def work
;TI" end
;TI" end
;TI"
;TI"describe Worker do
;TI" before do
;TI"* @worker = Worker.new(Object.new)
;TI" end
;TI"
;TI"$ it "must respond to work" do
;TI"' @worker.must_respond_to :work
;TI" end
;TI" end
;T;0o; ;[I"outputs a failure:;T@o;;[I" 1) Failure:
;TI":Worker#test_0001_must respond to work [bug11.rb:16]:
;TI"GExpected # (Object) to respond to #work.
;T;0o; ;[
I"LWorker is a SimpleDelegate which in 1.9+ is a subclass of BasicObject. ;TI"CExpectations are put on Object (one level down) so the Worker ;TI"F(SimpleDelegate) hits `method_missing` and delegates down to the ;TI"L`Object.new` instance. That object doesn't respond to work so the test ;TI"fails.;T@o; ;[I"LYou can bypass `SimpleDelegate#method_missing` by extending the worker ;TI"Lwith `MiniTest::Expectations`. You can either do that in your setup at ;TI"the instance level, like:;T@o;;[ I"before do
;TI"( @worker = Worker.new(Object.new)
;TI"- @worker.extend MiniTest::Expectations
;TI" end
;T;0o; ;[I"For you can extend the Worker class (within the test file!), like:;T@o;;[I"class Worker
;TI"( include ::MiniTest::Expectations
;TI" end
;T;0S;;i;
I"Known Extensions:;T@o;;;;[2o;;[I"!capybara_minitest_spec ;T;[o; ;[I"sBridge between Capybara RSpec matchers and MiniTest::Spec expectations (e.g. page.must_have_content('Title')).;To;;[I"!minispec-metadata ;T;[o; ;[I"%Metadata for describe/it blocks ;TI"2(e.g. `it 'requires JS driver', js: true do`);To;;[I"!minitest-ansi ;T;[o; ;[I"/Colorize minitest output with ANSI colors.;To;;[I"!minitest-around ;T;[o; ;[I"GAround block for minitest. An alternative to setup/teardown dance.;To;;[I"!minitest-capistrano ;T;[o; ;[I"?Assertions and expectations for testing Capistrano recipes;To;;[I"!minitest-capybara ;T;[o; ;[I"9Capybara matchers support for minitest unit and spec;To;;[I"!minitest-chef-handler ;T;[o; ;[I"0Run Minitest suites as Chef report handlers;To;;[I"!minitest-ci ;T;[o; ;[I"%CI reporter plugin for MiniTest.;To;;[I"!minitest-colorize ;T;[o; ;[I"?Colorize MiniTest output and show failing tests instantly.;To;;[I"!minitest-context ;T;[o; ;[I"1Defines contexts for code reuse in MiniTest ;TI"*specs that share common expectations.;To;;[I"!minitest-debugger ;T;[o; ;[I"1Wraps assert so failed assertions drop into ;TI"the ruby debugger.;To;;[I"!minitest-display ;T;[o; ;[I"APatches MiniTest to allow for an easily configurable output.;To;;[I"!minitest-emoji ;T;[o; ;[I"