Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
MiniTest /
Delete
Unzip
Name
Size
Permission
Date
Action
Assertion
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Assertions
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Expectations
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Mock
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Skip
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Spec
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Unit
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
cdesc-MiniTest.ri
9.14
KB
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalModule[iI" MiniTest:EF@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I".A simple and clean mock object framework.;T: @fileI"lib/minitest/mock.rb;To;;[Uo; ;[I"8Minimal (mostly drop-in) replacement for test-unit.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"minitest/*;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"'http://rubyforge.org/projects/bfts;T@S;; i;I"DESCRIPTION:;T@o; ;[I"Hminitest provides a complete suite of testing facilities supporting;TI")TDD, BDD, mocking, and benchmarking.;T@o; ;[I"Iminitest/unit is a small and incredibly fast unit testing framework.;TI"FIt provides a rich set of assertions to make your tests clean and;TI"readable.;T@o; ;[I"Hminitest/spec is a functionally complete spec engine. It hooks onto;TI"Fminitest/unit and seamlessly bridges test assertions over to spec;TI"expectations.;T@o; ;[ I"Kminitest/benchmark is an awesome way to assert the performance of your;TI"Ialgorithms in a repeatable manner. Now you can assert that your newb;TI"Hco-worker doesn't replace your linear algorithm with an exponential;TI" one!;T@o; ;[I"Eminitest/mock by Steven Baker, is a beautifully tiny mock object;TI"framework.;T@o; ;[I"Iminitest/pride shows pride in testing and adds coloring to your test;TI"output.;T@o; ;[ I"Gminitest/unit is meant to have a clean implementation for language;TI"Kimplementors that need a minimal set of methods to bootstrap a working;TI"Ftest suite. For example, there is no magic involved for test-case;TI"discovery.;T@S;; i;I"FEATURES/PROBLEMS:;T@o;;;;[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"4minitest/mock - a simple and clean mock 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:RDoc::Markup::Verbatim;[I"class Meme ;FI"" def i_can_has_cheezburger? ;FI" "OHAI!" ;FI" end ;FI" ;FI" def will_it_blend? ;FI" "YES!" ;FI" end ;FI" end ;FS;; i;I"Unit tests;T@o;;[I" require 'minitest/autorun' ;FI" ;FI"/class TestMeme < MiniTest::Unit::TestCase ;FI" def setup ;FI" @meme = Meme.new ;FI" end ;FI" ;FI"# def test_that_kitty_can_eat ;FI"< assert_equal "OHAI!", @meme.i_can_has_cheezburger? ;FI" end ;FI" ;FI"' def test_that_it_will_not_blend ;FI"3 refute_match /^no/i, @meme.will_it_blend? ;FI" end ;FI" end ;FS;; i;I" Specs;T@o;;[I" require 'minitest/autorun' ;FI" ;FI"describe Meme do ;FI" before do ;FI" @meme = Meme.new ;FI" end ;FI" ;FI"4 describe "when asked about cheeseburgers" do ;FI") it "must respond positively" do ;FI"; @meme.i_can_has_cheezburger?.must_equal "OHAI!" ;FI" end ;FI" end ;FI" ;FI"= describe "when asked about blending possibilities" do ;FI" it "won't say no" do ;FI"2 @meme.will_it_blend?.wont_match /^no/i ;FI" end ;FI" end ;FI" end ;FS;; i;I"Benchmarks;T@o; ;[I"KAdd 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! ;FI"2require 'minitest/benchmark' if ENV["BENCH"] ;FI" ;FI"/class TestMeme < MiniTest::Unit::TestCase ;FI"S # Override self.bench_range or default range is [1, 10, 100, 1_000, 10_000] ;FI" def bench_my_algorithm ;FI"F assert_performance_linear 0.9999 do |n| # n is a range value ;FI" n.times do ;FI" @obj.my_algorithm ;FI" end ;FI" end ;FI" end ;FI" end ;Fo; ;[I"GOr add them to your specs. If you make benchmarks optional, you'll;TI"Jneed to wrap your benchmarks in a conditional since the methods won't;TI"be defined.;T@o;;[I"describe Meme do ;FI" if ENV["BENCH"] then ;FI"@ bench_performance_linear "my_algorithm", 0.9999 do |n| ;FI" 100.times do ;FI"" @obj.my_algorithm(n) ;FI" end ;FI" end ;FI" end ;FI" end ;Fo; ;[I"outputs something like:;T@o;;[ I"# Running benchmarks: ;FI" ;FI"'TestBlah 100 1000 10000 ;FI"Cbench_my_algorithm 0.006167 0.079279 0.786993 ;FI"Kbench_other_algorithm 0.061679 0.792797 7.869932 ;Fo; ;[I"IOutput is tab-delimited to make it easy to paste into a spreadsheet.;T@S;; i;I" Mocks;T@o;;["I"class MemeAsker ;FI" def initialize(meme) ;FI" @meme = meme ;FI" end ;FI" ;FI" def ask(question) ;FI"- method = question.tr(" ","_") + "?" ;FI" @meme.send(method) ;FI" end ;FI" end ;FI" ;FI" require 'minitest/autorun' ;FI" ;FI"describe MemeAsker do ;FI" before do ;FI"$ @meme = MiniTest::Mock.new ;FI"+ @meme_asker = MemeAsker.new @meme ;FI" end ;FI" ;FI" describe "#ask" do ;FI"< describe "when passed an unpunctuated question" do ;FI"N it "should invoke the appropriate predicate method on the meme" do ;FI"9 @meme.expect :will_it_blend?, :return_value ;FI"- @meme_asker.ask "will it blend" ;FI" @meme.verify ;FI" end ;FI" end ;FI" end ;FI" end ;FS;; i;I"$Customizable Test Runner Types:;T@o; ;[ I"KMiniTest::Unit.runner=(runner) provides an easy way of creating custom;TI"Btest runners for specialized needs. Justin Weiss provides the;TI"Efollowing real-world example to create an alternative to regular;TI"fixture loading:;T@o;;[1I"4class MiniTestWithHooks::Unit < MiniTest::Unit ;FI" def before_suites ;FI" end ;FI" ;FI" def after_suites ;FI" end ;FI" ;FI"% def _run_suites(suites, type) ;FI" begin ;FI" before_suites ;FI" super(suites, type) ;FI" ensure ;FI" after_suites ;FI" end ;FI" end ;FI" ;FI"# def _run_suite(suite, type) ;FI" begin ;FI" suite.before_suite ;FI" super(suite, type) ;FI" ensure ;FI" suite.after_suite ;FI" end ;FI" end ;FI" end ;FI" ;FI"%module MiniTestWithTransactions ;FI", class Unit < MiniTestWithHooks::Unit ;FI"! include TestSetupHelper ;FI" ;FI" def before_suites ;FI" super ;FI"% setup_nested_transactions ;FI"; # load any data we want available for all tests ;FI" end ;FI" ;FI" def after_suites ;FI"( teardown_nested_transactions ;FI" super ;FI" end ;FI" end ;FI" end ;FI" ;FI"@MiniTest::Unit.runner = MiniTestWithTransactions::Unit.new ;FS;; i;I"REQUIREMENTS:;T@o;;;;[o;;0;[o; ;[I"=Ruby 1.8, maybe even 1.6 or lower. No magic is involved.;T@S;; i;I" INSTALL:;T@o;;[I"sudo gem install minitest ;Fo; ;[I"JOn 1.9, you already have it. To get newer candy you can still install;TI"Gthe gem, but you'll need to activate the gem explicitly to use it:;T@o;;[ I"require 'rubygems' ;FI"Lgem 'minitest' # ensures you're using the gem, and not the built in MT ;FI" require 'minitest/autorun' ;FI" ;FI"$# ... usual testing stuffs ... ;FS;; i;I" LICENSE:;T@o; ;[I"(The MIT License);T@o; ;[I")Copyright (c) Ryan Davis, Seattle.rb;T@o; ;[I"JPermission is hereby granted, free of charge, to any person obtaining;TI"Da copy of this software and associated documentation files (the;TI"H'Software'), to deal in the Software without restriction, including;TI"Hwithout limitation the rights to use, copy, modify, merge, publish,;TI"Gdistribute, sublicense, and/or sell copies of the Software, and to;TI"Jpermit persons to whom the Software is furnished to do so, subject to;TI"the following conditions:;T@o; ;[I"CThe above copyright notice and this permission notice shall be;TI"Dincluded in all copies or substantial portions of the Software.;T@o; ;[I"DTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,;TI"GEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF;TI"KMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.;TI"IIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY;TI"ICLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,;TI"FTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE;TI";SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.;T; I"lib/minitest/unit.rb;T; 0[ [[I" MINI_DIR;Fo;;[o; ;[I"B'./lib' in project dir, or '/usr/local/blahblah' if installed;T; 0@d[ [[I" class;F[[:public[ [:protected[ [:private[ [I" instance;F[[;[ [;[ [;[