Skip to content

Instantly share code, notes, and snippets.

@dbussink
Created October 20, 2008 19:22
Show Gist options
  • Save dbussink/18146 to your computer and use it in GitHub Desktop.
Save dbussink/18146 to your computer and use it in GitHub Desktop.
dbussink@ey04-s00167 ~/ci/extlib $ multiruby /usr/bin/rake ci
VERSION = 1.8.7-p72
CMD = ~/.multiruby/install/1.8.7-p72/bin/ruby /usr/bin/rake ci
(in /home/dbussink/ci/extlib)
rm -rf /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci/doc
mkdir -p /home/dbussink/ci/extlib/ci/cyclomatic
mkdir -p /home/dbussink/ci/extlib/ci/token
rm -r coverage
Time#to_json
- should transform itself into a ISO 8601 compatible string
Time#to_time
- should return a copy of its self
Mash
Mash#initialize
- converts all keys into strings when param is a Hash
- converts all pure Hash values into Mashes if param is a Hash
- doesn not convert Hash subclass values into Mashes
- converts all value items if value is an Array
- delegates to superclass constructor if param is not a Hash
Mash#update
- converts all keys into strings when param is a Hash
- converts all Hash values into Mashes if param is a Hash
Mash#[]=
- converts key into string
- converts all Hash value into Mash
Mash#key?
- converts key before lookup
- is aliased as include?
- is aliased as member?
Mash#dup
- returns instance of Mash
- preserves keys
- preserves value
Mash#to_hash
- returns instance of Mash
- preserves keys
- preserves value
Mash#delete
- converts Symbol key into String before deleting
- works with String keys as well
Mash#except
- converts Symbol key into String before calling super
- works with String keys as well
- works with multiple keys
- should return a mash
Mash#merge
- returns instance of Mash
- merges in give Hash
Mash#fetch
- converts key before fetching
- returns alternative value if key lookup fails
Mash#default
- returns default value unless key exists in mash
- returns existing value if key is Symbol and exists in mash
Mash#values_at
- is indifferent to whether keys are strings or symbols
Mash#stringify_keys!
- returns the mash itself
Object
- should provide blank?
- should be blank if it is nil
- should be blank if it is empty
- should not be blank if not nil or empty
Numeric
- should provide blank?
- should never be blank
NilClass
- should provide blank?
- should always be blank
TrueClass
- should provide blank?
- should never be blank
FalseClass
- should provide blank?
- should always be blank
String
- should provide blank?
- should be blank if empty
- should be blank if it only contains whitespace
- should not be blank if it contains non-whitespace
String#to_const_string
- swaps slashes with ::
- replaces snake_case with CamelCase
- leaves constant string as is
String#to_const_path
- swaps :: with slash
- snake_cases string
- leaves slash-separated snake case string as is
String#camel_case
- handles lowercase without underscore
- handles lowercase with 1 underscore
- handles lowercase with more than 1 underscore
- handles lowercase with more than 1 underscore in a row
- handle first capital letter with underscores
- leaves CamelCase as is
String#snake_case
- lowercases one word CamelCase
- makes one underscore snake_case two word CamelCase
- handles CamelCase with more than 2 words
- handles CamelCase with more than 2 capital letter in a row
- does NOT change one word lowercase
- leaves snake_case as is
String#escape_regexp
- escapes all * in a string
- escapes all ? in a string
- escapes all { in a string
- escapes all } in a string
- escapes all . in a string
- escapes all regexp special characters used in a string
String#unescape_regexp
- unescapes all \* in a string
- unescapes all \? in a string
- unescapes all \{ in a string
- unescapes all \} in a string
- unescapes all \. in a string
- unescapes all regexp special characters used in a string
String#/
- concanates operands with File::SEPARATOR
String#relative_path_from
- uses other operand as base for path calculation
String.translate
- looks up for translation in translations dictionary
- returns string that has no translations as it is
String.t
- looks up for translation in translations dictionary and translates parameters as well
- returns string that has no translations as it is
- should not translate when freezed
String.translations
- returns empty hash by default
- returns @translations if set (PENDING: is it @translations on metaclass or @@translations? leaving it out for now)
Extlib::SimpleSet
- should support <<
- should support merge
- should support inspect
Extlib::Inflection#singular
- pluralizes equipment => equipment
- pluralizes information => information
- pluralizes money => money
- pluralizes species => species
- pluralizes series => series
- pluralizes fish => fish
- pluralizes sheep => sheep
- pluralizes news => news
- pluralizes rain => rain
- pluralizes milk => milk
- pluralizes moose => moose
- pluralizes hovercraft => hovercraft
- pluralizes cacti => cactus
- pluralizes thesaurus => thesauri
- pluralizes matrix => matrices
- pluralizes Swiss => Swiss
- pluralizes life => lives
- pluralizes wife => wives
- pluralizes goose => geese
- pluralizes criterion => criteria
- pluralizes alias => aliases
- pluralizes status => statuses
- pluralizes axis => axes
- pluralizes crisis => crises
- pluralizes testis => testes
- pluralizes child => children
- pluralizes person => people
- pluralizes potato => potatoes
- pluralizes tomato => tomatoes
- pluralizes buffalo => buffaloes
- pluralizes torpedo => torpedoes
- pluralizes quiz => quizzes
- pluralizes vertex => vertices
- pluralizes index => indices
- pluralizes ox => oxen
- pluralizes mouse => mice
- pluralizes louse => lice
- pluralizes thesis => theses
- pluralizes thief => thieves
- pluralizes analysis => analyses
- pluralizes octopus => octopi
- pluralizes grass => grass
- pluralizes phenomenon => phenomena
- pluralizes forum => forums
- pluralizes hive => hives
- pluralizes athlete => athletes
- pluralizes dwarf => dwarves
- pluralizes hero => heroes
- pluralizes zero => zeroes
- pluralizes man => men
- pluralizes woman => women
- pluralizes sportsman => sportsmen
- pluralizes branch => branches
- pluralizes crunch => crunches
- pluralizes trash => trashes
- pluralizes mash => mashes
- pluralizes cross => crosses
- pluralizes erratum => errata
- pluralizes ray => rays
- pluralizes spray => sprays
- pluralizes prey => preys
- pluralizes toy => toys
- pluralizes joy => joys
- pluralizes buy => buys
- pluralizes guy => guys
- pluralizes cry => cries
- pluralizes fly => flies
- pluralizes fox => foxes
- pluralizes elf => elves
- pluralizes shelf => shelves
- pluralizes plus => plusses
- pluralizes cat => cats
- pluralizes rat => rats
- pluralizes rose => roses
- pluralizes project => projects
- pluralizes post => posts
- pluralizes article => articles
- pluralizes location => locations
- pluralizes friend => friends
- pluralizes link => links
- pluralizes url => urls
- pluralizes account => accounts
- pluralizes server => servers
- pluralizes fruit => fruits
- pluralizes map => maps
- pluralizes income => incomes
- pluralizes ping => pings
- pluralizes event => events
- pluralizes proof => proofs
- pluralizes typo => typos
- pluralizes attachment => attachments
- pluralizes download => downloads
- pluralizes asset => assets
- pluralizes job => jobs
- pluralizes city => cities
- pluralizes package => packages
- pluralizes commit => commits
- pluralizes version => versions
- pluralizes document => documents
- pluralizes edition => editions
- pluralizes movie => movies
- pluralizes song => songs
- pluralizes invoice => invoices
- pluralizes product => products
- pluralizes book => books
- pluralizes ticket => tickets
- pluralizes game => games
- pluralizes tournament => tournaments
- pluralizes prize => prizes
- pluralizes price => prices
- pluralizes installation => installations
- pluralizes date => dates
- pluralizes schedule => schedules
- pluralizes arena => arenas
- pluralizes spam => spams
- pluralizes bus => buses
- pluralizes rice => rice
- pluralizes cow => kine
- pluralizes horse => horses
- pluralizes shoe => shoes
- pluralizes photo => photos
- pluralizes old_news => old_news
- pluralizes comment => comments
- pluralizes node_child => node_children
- pluralizes wish => wishes
- pluralizes address => addresses
- pluralizes box => boxes
- pluralizes portfolio => portfolios
- pluralizes medium => media
- pluralizes diagnosis_a => diagnosis_as
- pluralizes basis => bases
- pluralizes ability => abilities
- pluralizes category => categories
- pluralizes stack => stacks
- pluralizes safe => saves
- pluralizes switch => switches
- pluralizes salesperson => salespeople
- pluralizes matrix_fu => matrix_fus
- pluralizes house => houses
- pluralizes foobar => foobars
- pluralizes archive => archives
- pluralizes process => processes
- pluralizes axis => axes
- pluralizes case => cases
- pluralizes status_code => status_codes
- pluralizes perspective => perspectives
- pluralizes day => days
- pluralizes datum => data
- pluralizes move => moves
- pluralizes newsletter => newsletters
- pluralizes agency => agencies
- pluralizes spokesman => spokesmen
- pluralizes half => halves
- pluralizes edge => edges
- pluralizes virus => viruses
- pluralizes experience => experiences
- pluralizes diagnosis => diagnoses
- pluralizes query => queries
- pluralizes fix => fixes
- pluralizes search => searches
Extlib::Inflection#singular
- singularizes equipment => equipment
- singularizes postgres => postgres
- singularizes mysql => mysql
- singularizes information => information
- singularizes money => money
- singularizes species => species
- singularizes series => series
- singularizes fish => fish
- singularizes sheep => sheep
- singularizes news => news
- singularizes rain => rain
- singularizes milk => milk
- singularizes moose => moose
- singularizes hovercraft => hovercraft
- singularizes cactus => cacti
- singularizes thesauri => thesaurus
- singularizes matrices => matrix
- singularizes Swiss => Swiss
- singularizes lives => life
- singularizes wives => wife
- singularizes geese => goose
- singularizes criteria => criterion
- singularizes aliases => alias
- singularizes statuses => status
- singularizes axes => axis
- singularizes crises => crisis
- singularizes testes => testis
- singularizes children => child
- singularizes people => person
- singularizes potatoes => potato
- singularizes tomatoes => tomato
- singularizes buffaloes => buffalo
- singularizes torpedoes => torpedo
- singularizes quizzes => quiz
- singularizes vertices => vertex
- singularizes indices => index
- singularizes oxen => ox
- singularizes mice => mouse
- singularizes lice => louse
- singularizes theses => thesis
- singularizes thieves => thief
- singularizes analyses => analysis
- singularizes octopi => octopus
- singularizes grass => grass
- singularizes phenomena => phenomenon
- singularizes forums => forum
- singularizes hives => hive
- singularizes athletes => athlete
- singularizes dwarves => dwarf
- singularizes heroes => hero
- singularizes zeroes => zero
- singularizes men => man
- singularizes women => woman
- singularizes sportsmen => sportsman
- singularizes branches => branch
- singularizes crunches => crunch
- singularizes trashes => trash
- singularizes mashes => mash
- singularizes crosses => cross
- singularizes errata => erratum
- singularizes rays => ray
- singularizes sprays => spray
- singularizes preys => prey
- singularizes toys => toy
- singularizes joys => joy
- singularizes buys => buy
- singularizes guys => guy
- singularizes cries => cry
- singularizes flies => fly
- singularizes foxes => fox
- singularizes elves => elf
- singularizes shelves => shelf
- singularizes pluses => plus
- singularizes cats => cat
- singularizes rats => rat
- singularizes roses => rose
- singularizes projects => project
- singularizes posts => post
- singularizes articles => article
- singularizes locations => location
- singularizes friends => friend
- singularizes links => link
- singularizes urls => url
- singularizes accounts => account
- singularizes servers => server
- singularizes fruits => fruit
- singularizes maps => map
- singularizes incomes => income
- singularizes pings => ping
- singularizes events => event
- singularizes proofs => proof
- singularizes typos => typo
- singularizes attachments => attachment
- singularizes downloads => download
- singularizes assets => asset
- singularizes jobs => job
- singularizes cities => city
- singularizes packages => package
- singularizes commits => commit
- singularizes versions => version
- singularizes documents => document
- singularizes editions => edition
- singularizes movies => movie
- singularizes songs => song
- singularizes invoices => invoice
- singularizes products => product
- singularizes books => book
- singularizes tickets => ticket
- singularizes games => game
- singularizes tournaments => tournament
- singularizes prizes => prize
- singularizes prices => price
- singularizes installations => installation
- singularizes dates => date
- singularizes schedules => schedule
- singularizes arenas => arena
- singularizes spams => spam
- singularizes rice => rice
Symbol#/
- concanates operands with File::SEPARATOR
Extlib::Pooling
- should track the initialized pools
- should maintain a size of 1
- should allow you to overwrite Class#new
- should raise a ThreadStopError when the pool is exhausted in a single thread
- should allow multiple threads to access the pool
- should allow you to flush a pool
- should wake up the scavenger thread when exiting
ObjectSpace#classes
- returns only classes, nothing else
Class#inheritable_accessor
- inherits from parent unless overriden
- inherits from grandparent unless overriden
- inherits even if the accessor is made after the inheritance
- supports ||= to change a child
- supports << to change a child when the parent is an Array
- supports ! methods on an Array
- support modifying a parent Hash
- supports hard-merging a parent Hash
- supports changes to the parent even if the child has already been read
- handles nil being set midstream
- handles false being used in Parent
- handles the grandparent changing the value (as long as the child isn't read first)
Object
Object#full_const_get
- returns constant by FQ name in receiver namespace
Object#full_const_set
- sets constant value by FQ name in receiver namespace
Object#make_module
- creates a module from string FQ name
- handles the case where we already have a class in the heirarchy
Object#quacks_like?
- returns true if duck is a Symbol and receiver responds to it
- returns false if duck is a Symbol and receiver DOES NOT respond to it
- returns true if duck is a class and receiver is its instance
- returns false if duck is a class and receiver IS NOT its instance
- returns true if duck is an array and at least one of its members quacks like this duck
- returns false if duck is an array and none of its members quacks like this duck
Object#in?
- returns true if object is included in collection
Object#encoded_hash
- returns the encoded hash like the value in the default Object#inspect
Extlib::Inflection
Extlib::Inflection#classify
- classifies data_mapper as DataMaper
- singularizes string first: classifies data_mappers as egg_and_hams as EggAndHam
Extlib::Inflection#camelize
- camelizes data_mapper as DataMapper
- camelizes merb as Merb
- camelizes data_mapper/resource as DataMapper::Resource
- camelizes data_mapper/associations/one_to_many as DataMapper::Associations::OneToMany
Extlib::Inflection#underscore
- underscores DataMapper as data_mapper
- underscores Merb as merb
- underscores DataMapper::Resource as data_mapper/resource
- underscores Merb::BootLoader::Rackup as merb/boot_loader/rackup
Extlib::Inflection#humanize
- replaces _ with space: humanizes employee_salary as Employee salary
- strips _id endings: humanizes author_id as Author
Extlib::Inflection#demodulize
- demodulizes module name: DataMapper::Inflector => Inflector
- demodulizes module name: A::B::C::D::E => E
Extlib::Inflection#tableize
- pluralizes last word in snake_case strings: fancy_category => fancy_categories
- underscores CamelCase strings before pluralization: FancyCategory => fancy_categories
- replaces :: with underscores: Fancy::Category => fancy_categories
Extlib::Inflection#foreign_key
- adds _id to downcased string: Message => message_id
- demodulizes string first: Admin::Post => post_id
Extlib::Hook
Extlib::Hook explicit hookable method registration
Extlib::Hook explicit hookable method registration for class methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on methods from module extensions
- should allow modules to register hooks in the self.extended method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow advising methods ending in ? or !
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook explicit hookable method registration for instance methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on included module methods
- should allow modules to register hooks in the self.included method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow hooking methods ending in ? or ! with block hooks
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook implicit hookable method registration
Extlib::Hook implicit hookable method registration for class methods
- should implicitly register the method as hookable
Extlib::Hook implicit hookable method registration for instance methods
- should implicitly register the method as hookable
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook method registration
Extlib::Hook hook method registration for class methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook method registration for instance methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook invocation without inheritance
Extlib::Hook hook invocation without inheritance for class methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation without inheritance for instance methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should not pass the method return value to the after hook if the method does not take arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation with class inheritance
Extlib::Hook hook invocation with class inheritance for class methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in the parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with class inheritance for instance methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with module inclusions / extensions
Extlib::Hook hook invocation with module inclusions / extensions for class methods
- should not overwrite methods included by extensions after the hook is declared
Extlib::Hook hook invocation with module inclusions / extensions for instance methods
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook invocation with unrelated classes
Extlib::Hook hook invocation with unrelated classes for class methods
- should not execute hooks registered in an unrelated class
Extlib::Hook hook invocation with unrelated classes for instance methods
- should not execute hooks registered in an unrelated class
Extlib::Hook using before hook
Extlib::Hook using before hook for class methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using before hook for instance methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using after hook
Extlib::Hook using after hook for class methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook using after hook for instance methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should return nil if an after hook throws :halt without a return value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook aborting
Extlib::Hook aborting for class methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
- should return nil if an after hook throws :halt without a return value
Extlib::Hook aborting for instance methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
Extlib::Hook aborting with return values
Extlib::Hook aborting with return values for class methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook aborting with return values for instance methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook helper methods
- should generate the correct argument signature
Hash environmentize_keys!
- should transform keys to uppercase text
- should only transform one level of keys
Hash only
- should return a hash with only the given key(s)
Hash except
- should return a hash without only the given key(s)
Hash to_xml_attributes
- should turn the hash into xml attributes
- should preserve _ in hash keys
Hash from_xml
- should transform a simple tag with content
- should work with cdata tags
- should transform a simple tag with attributes
- should transform repeating siblings into an array
- should not transform non-repeating siblings into an array
- should typecast an integer
- should typecast a true boolean
- should typecast a false boolean
- should typecast a datetime
- should typecast a date
- should unescape html entities
- should undasherize keys as tags
- should undasherize keys as attributes
- should undasherize keys as tags and attributes
- should render nested content correctly
- should render nested content with split text nodes correctly
- should ignore attributes when a child is a text node
- should ignore attributes when any child is a text node
- should correctly transform multiple children
- should properly handle nil values (ActiveSupport Compatible)
- should handle a single record from xml (ActiveSupport Compatible)
- should handle multiple records (ActiveSupport Compatible)
- should handle a single record from_xml with attributes other than type (ActiveSupport Compatible)
- should handle an emtpy array (ActiveSupport Compatible)
- should handle empty array with whitespace from xml (ActiveSupport Compatible)
- should handle array with one entry from_xml (ActiveSupport Compatible)
- should handle array with multiple entries from xml (ActiveSupport Compatible)
- should handle file types (ActiveSupport Compatible)
- should handle file from xml with defaults (ActiveSupport Compatible)
- should handle xsd like types from xml (ActiveSupport Compatible)
- should let type trickle through when unknown (ActiveSupport Compatible)
- should handle unescaping from xml (ActiveResource Compatible)
Hash to_params
- should covert hash: {"foo"=>{"1"=>"bar", "2"=>"baz"}} to params: "foo[1]=bar&foo[2]=baz"
- should covert hash: {"foo"=>{"bar"=>[{"baz"=>1}, {"baz"=>"2"}]}} to params: "foo[bar][][baz]=1&foo[bar][][baz]=2"
- should covert hash: {"foo"=>[{"bar"=>"1"}, {"bar"=>2}]} to params: "foo[][bar]=1&foo[][bar]=2"
- should covert hash: {"foo"=>["bar", "baz"]} to params: "foo[]=bar&foo[]=baz"
- should covert hash: {"baz"=>"bat", "foo"=>"bar"} to params: "foo=bar&baz=bat"
- should not leave a trailing &
Hash to_mash
- copies default Hash value to Mash
Struct
- should have attributes
LazyArray
- should provide #at
- should provide #clear
- should provide #collect!
- should provide #concat
- should provide #delete
- should provide #delete_at
- should provide #dup
- should provide #each
- should provide #each_index
- should provide #empty?
- should provide #entries
- should provide #freeze
- should provide #eql?
- should provide #fetch
- should provide #first
- should provide #index
- should provide #insert
- should provide #last
- should provide #length
- should provide #loaded?
- should provide #partition
- should provide #pop
- should provide #push
- should provide #reject
- should provide #reject!
- should provide #replace
- should provide #reverse
- should provide #reverse!
- should provide #reverse_each
- should provide #rindex
- should provide #select
- should provide #shift
- should provide #slice
- should provide #slice!
- should provide #sort
- should provide #sort!
- should provide #to_a
- should provide #to_ary
- should provide #to_proc
- should provide #unload
- should provide #unshift
- should provide #values_at
LazyArray#at
- should delegate to the array and return the results directly
- should lookup the entry by index
LazyArray#clear
- should delegate to the array and return self
- should return self
- should make the lazy array become empty
- should be loaded afterwards
LazyArray#collect!
- should delegate to the array and return self
- should return self
- should iterate over the lazy array
- should update the lazy array with the result of the block
LazyArray#concat
- should delegate to the array and return self
- should return self
- should concatenate another lazy array with #concat
LazyArray#delete
- should delegate to the array and return the results directly
- should delete the matching entry from the lazy array
- should use the passed-in block when no entry was removed
LazyArray#delete_at
- should delegate to the array and return the results directly
- should delete the entry from the lazy array with the index
LazyArray#dup
- should delegate to the array and return the results directly
- should copy the original array
- should copy the original load proc
LazyArray#each
- should delegate to the array and return self
- should return self
- should iterate over the lazy array entries
LazyArray#each_index
- should delegate to the array and return self
- should return self
- should iterate over the lazy array by index
LazyArray#empty?
- should delegate to the array and return the results directly
- should return true if the lazy array has entries
- should return false if the lazy array has no entries
LazyArray#entries
- should delegate to the array and return the results directly
- should return an Array
LazyArray#freeze
- should delegate to the array and return self
- should freeze the underlying array
LazyArray#eql?
- should delegate to the array and return the results directly
- should return true if for the same lazy array
- should return true for duplicate lazy arrays
- should return false for different lazy arrays
LazyArray#fetch
- should delegate to the array and return the results directly
- should lookup the entry with an index
- should throw an IndexError exception if the index is outside the array
- should substitute the default if the index is outside the array
- should substitute the value returned by the default block if the index is outside the array
LazyArray#first
- should delegate to the array and return the results directly
LazyArray#first with no arguments
- should return the first entry in the lazy array
LazyArray#first with number of results specified
- should return an Array
LazyArray#index
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the first matching entry in the lazy array
LazyArray#insert
- should delegate to the array and return self
- should return self
- should insert the entry at index in the lazy array
LazyArray#last
- should delegate to the array and return the results directly
LazyArray#last with no arguments
- should return the last entry in the lazy array
LazyArray#last with number of results specified
- should return an Array
LazyArray#length
- should delegate to the array and return the results directly
- should return an Integer
- should return the length of the lazy array
LazyArray#loaded?
- should return true for an initialized lazy array
- should return false for an uninitialized lazy array
LazyArray#partition
LazyArray#partition return value
- should be an Array
- should have two entries
LazyArray#partition return value first entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#partition return value second entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#pop
- should delegate to the array and return the results directly
- should remove the last entry
LazyArray#push
- should delegate to the array and return self
- should return self
- should append an entry
LazyArray#reject
- should delegate to the array and return the results directly
- should return an Array with entries that did not match the block
- should return an empty Array if entries matched the block
LazyArray#reject!
- should delegate to the array and return self
- should return self if entries matched the block
- should return nil if no entries matched the block
- should remove entries that matched the block
- should not remove entries that did not match the block
LazyArray#replace
- should delegate to the array and return self
- should return self
- should replace itself with the other object
- should be loaded afterwards
LazyArray#reverse
- should delegate to the array and return the results directly
- should return an Array with reversed entries
LazyArray#reverse!
- should delegate to the array and return self
- should return self
- should reverse the order of entries in the lazy array inline
LazyArray#reverse_each
- should delegate to the array and return self
- should return self
- should iterate through the lazy array in reverse
LazyArray#rindex
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the last matching entry in the lazy array
LazyArray#select
- should delegate to the array and return the results directly
- should return an Array with entries that matched the block
- should return an empty Array if no entries matched the block
LazyArray#shift
- should delegate to the array and return the results directly
- should remove the first entry
LazyArray#slice
- should delegate to the array and return the results directly
LazyArray#slice with an index
- should not modify the lazy array
LazyArray#slice with a start and length
- should return an Array
- should not modify the lazy array
LazyArray#slice with a Range
- should return an Array
- should not modify the lazy array
LazyArray#slice!
- should delegate to the array and return the results directly
LazyArray#slice! with an index
- should modify the lazy array
LazyArray#slice! with a start and length
- should return an Array
- should modify the lazy array
LazyArray#slice! with a Range
- should return an Array
- should modify the lazy array
LazyArray#sort
- should delegate to the array and return the results directly
- should return an Array
- should sort the entries
LazyArray#sort!
- should delegate to the array and return self
- should return self
- should sort the LazyArray in place
LazyArray#to_a
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_ary
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_proc
- should return a Prox
- should return the proc supplied to load_with
LazyArray#unload
- should return self
- should make the lazy array become empty
- should not be loaded afterwards
LazyArray#unshift
- should delegate to the array and return self
- should return self
- should prepend an entry
LazyArray#values_at
- should delegate to the array and return the results directly
- should return an Array
- should return an Array of the entries at the index
LazyArray a method mixed into Array
- should delegate to the Array
LazyArray an unknown method
- should raise an exception
try_dup
- returns a duplicate version on regular objects
- returns self on Numerics
- returns self on Symbols
- returns self on true
- returns self on false
- returns self on nil
- returns self on modules
Module
- should raise NameError for a missing constant
- should be able to get a recursive constant
- should ignore get Constants from the Kernel namespace correctly
- should find relative constants
- should find sibling constants
- should find nested constants on nested constants
- should be able to deal with constants being added and removed
DateTime#to_time
- should return a copy of time
Time#to_datetime
- should return a copy of its self
VirtualFile
- inherits from StringIO
- has path reader
- has path writer
Pending:
String.translations returns @translations if set (is it @translations on metaclass or @@translations? leaving it out for now)
Finished in 2.688063 seconds
770 examples, 0 failures, 1 pending
91.0% 25 file(s) 2702 Lines 1415 LOC
mv /home/dbussink/ci/extlib/coverage /home/dbussink/ci/extlib/ci/coverage
RESULT = 0
VERSION = 1.9.0-4
CMD = ~/.multiruby/install/1.9.0-4/bin/ruby /usr/bin/rake ci
(in /home/dbussink/ci/extlib)
rm -rf /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci/doc
mkdir -p /home/dbussink/ci/extlib/ci/cyclomatic
mkdir -p /home/dbussink/ci/extlib/ci/token
rm -r coverage
/usr/bin/rcov:19:in `load': /home/dbussink/.multiruby/install/1.9.0-4/lib/ruby/gems/1.9.0/gems/rcov-0.8.1.2.0/bin/rcov:281: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError)
... when /([^.]+)(#|\.)(.*)/: options.report_cov_bug_for =...
... ^
/home/dbussink/.multiruby/install/1.9.0-4/lib/ruby/gems/1.9.0/gems/rcov-0.8.1.2.0/bin/rcov:282: syntax error, unexpected keyword_else, expecting keyword_end
/home/dbussink/.multiruby/install/1.9.0-4/lib/ruby/gems/1.9.0/gems/rcov-0.8.1.2.0/bin/rcov:293: syntax error, unexpected keyword_end, expecting $end
from /usr/bin/rcov:19:in `<main>'
rake aborted!
Command /home/dbussink/.multiruby/install/1.9.0-4/bin/ruby -I"/home/dbussink/.multiruby/install/1.9.0-4/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib" -S rcov --exclude lib\/spec,bin\/spec,config\/boot.rb --exclude spec --text-summary --sort coverage --sort-reverse -o "coverage" "/home/dbussink/.multiruby/install/1.9.0-4/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/bin/spec" -- "spec/time_spec.rb" "spec/mash_spec.rb" "spec/blank_spec.rb" "spec/string_spec.rb" "spec/simple_set_spec.rb" "spec/inflection/plural_spec.rb" "spec/inflection/singular_spec.rb" "spec/symbol_spec.rb" "spec/pooling_spec.rb" "spec/object_space_spec.rb" "spec/class_spec.rb" "spec/object_spec.rb" "spec/inflection_extras_spec.rb" "spec/hook_spec.rb" "spec/hash_spec.rb" "spec/struct_spec.rb" "spec/lazy_array_spec.rb" "spec/try_dup_spec.rb" "spec/module_spec.rb" "spec/datetime_spec.rb" "spec/virtual_file_spec.rb" --format specdoc --colour --loadby random failed
/home/dbussink/ci/extlib/Rakefile:138:in `block (2 levels) in <top (required)>'
(See full trace by running task with --trace)
RESULT = 256
VERSION = 1.8.5-p115
CMD = ~/.multiruby/install/1.8.5-p115/bin/ruby /usr/bin/rake ci
(in /home/dbussink/ci/extlib)
rm -rf /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci/doc
mkdir -p /home/dbussink/ci/extlib/ci/cyclomatic
mkdir -p /home/dbussink/ci/extlib/ci/token
rm -r coverage
Time#to_json
- should transform itself into a ISO 8601 compatible string
Time#to_time
- should return a copy of its self
Mash
Mash#initialize
- converts all keys into strings when param is a Hash
- converts all pure Hash values into Mashes if param is a Hash
- doesn not convert Hash subclass values into Mashes
- converts all value items if value is an Array
- delegates to superclass constructor if param is not a Hash
Mash#update
- converts all keys into strings when param is a Hash
- converts all Hash values into Mashes if param is a Hash
Mash#[]=
- converts key into string
- converts all Hash value into Mash
Mash#key?
- converts key before lookup
- is aliased as include?
- is aliased as member?
Mash#dup
- returns instance of Mash
- preserves keys
- preserves value
Mash#to_hash
- returns instance of Mash
- preserves keys
- preserves value
Mash#delete
- converts Symbol key into String before deleting
- works with String keys as well
Mash#except
- converts Symbol key into String before calling super
- works with String keys as well
- works with multiple keys
- should return a mash
Mash#merge
- returns instance of Mash
- merges in give Hash
Mash#fetch
- converts key before fetching
- returns alternative value if key lookup fails
Mash#default
- returns default value unless key exists in mash
- returns existing value if key is Symbol and exists in mash
Mash#values_at
- is indifferent to whether keys are strings or symbols
Mash#stringify_keys!
- returns the mash itself
Object
- should provide blank?
- should be blank if it is nil
- should be blank if it is empty
- should not be blank if not nil or empty
Numeric
- should provide blank?
- should never be blank
NilClass
- should provide blank?
- should always be blank
TrueClass
- should provide blank?
- should never be blank
FalseClass
- should provide blank?
- should always be blank
String
- should provide blank?
- should be blank if empty
- should be blank if it only contains whitespace
- should not be blank if it contains non-whitespace
String#to_const_string
- swaps slashes with ::
- replaces snake_case with CamelCase
- leaves constant string as is
String#to_const_path
- swaps :: with slash
- snake_cases string
- leaves slash-separated snake case string as is
String#camel_case
- handles lowercase without underscore
- handles lowercase with 1 underscore
- handles lowercase with more than 1 underscore
- handles lowercase with more than 1 underscore in a row
- handle first capital letter with underscores
- leaves CamelCase as is
String#snake_case
- lowercases one word CamelCase
- makes one underscore snake_case two word CamelCase
- handles CamelCase with more than 2 words
- handles CamelCase with more than 2 capital letter in a row
- does NOT change one word lowercase
- leaves snake_case as is
String#escape_regexp
- escapes all * in a string
- escapes all ? in a string
- escapes all { in a string
- escapes all } in a string
- escapes all . in a string
- escapes all regexp special characters used in a string
String#unescape_regexp
- unescapes all \* in a string
- unescapes all \? in a string
- unescapes all \{ in a string
- unescapes all \} in a string
- unescapes all \. in a string
- unescapes all regexp special characters used in a string
String#/
- concanates operands with File::SEPARATOR
String#relative_path_from
- uses other operand as base for path calculation
String.translate
- looks up for translation in translations dictionary
- returns string that has no translations as it is
String.t
- looks up for translation in translations dictionary and translates parameters as well
- returns string that has no translations as it is
- should not translate when freezed
String.translations
- returns empty hash by default
- returns @translations if set (PENDING: is it @translations on metaclass or @@translations? leaving it out for now)
Extlib::SimpleSet
- should support <<
- should support merge
- should support inspect
Symbol#/
- concanates operands with File::SEPARATOR
Extlib::Pooling
- should track the initialized pools
- should maintain a size of 1
- should allow you to overwrite Class#new
- should raise a ThreadStopError when the pool is exhausted in a single thread
- should allow multiple threads to access the pool
- should allow you to flush a pool
- should wake up the scavenger thread when exiting
ObjectSpace#classes
- returns only classes, nothing else
Class#inheritable_accessor
- inherits from parent unless overriden
- inherits from grandparent unless overriden
- inherits even if the accessor is made after the inheritance
- supports ||= to change a child
- supports << to change a child when the parent is an Array
- supports ! methods on an Array
- support modifying a parent Hash
- supports hard-merging a parent Hash
- supports changes to the parent even if the child has already been read
- handles nil being set midstream
- handles false being used in Parent
- handles the grandparent changing the value (as long as the child isn't read first)
Object
Object#full_const_get
- returns constant by FQ name in receiver namespace
Object#full_const_set
- sets constant value by FQ name in receiver namespace
Object#make_module
- creates a module from string FQ name
- handles the case where we already have a class in the heirarchy
Object#quacks_like?
- returns true if duck is a Symbol and receiver responds to it
- returns false if duck is a Symbol and receiver DOES NOT respond to it
- returns true if duck is a class and receiver is its instance
- returns false if duck is a class and receiver IS NOT its instance
- returns true if duck is an array and at least one of its members quacks like this duck
- returns false if duck is an array and none of its members quacks like this duck
Object#in?
- returns true if object is included in collection
Object#encoded_hash
- returns the encoded hash like the value in the default Object#inspect
Extlib::Inflection
Extlib::Inflection#classify
- classifies data_mapper as DataMaper
- singularizes string first: classifies data_mappers as egg_and_hams as EggAndHam
Extlib::Inflection#camelize
- camelizes data_mapper as DataMapper
- camelizes merb as Merb
- camelizes data_mapper/resource as DataMapper::Resource
- camelizes data_mapper/associations/one_to_many as DataMapper::Associations::OneToMany
Extlib::Inflection#underscore
- underscores DataMapper as data_mapper
- underscores Merb as merb
- underscores DataMapper::Resource as data_mapper/resource
- underscores Merb::BootLoader::Rackup as merb/boot_loader/rackup
Extlib::Inflection#humanize
- replaces _ with space: humanizes employee_salary as Employee salary
- strips _id endings: humanizes author_id as Author
Extlib::Inflection#demodulize
- demodulizes module name: DataMapper::Inflector => Inflector
- demodulizes module name: A::B::C::D::E => E
Extlib::Inflection#tableize
- pluralizes last word in snake_case strings: fancy_category => fancy_categories
- underscores CamelCase strings before pluralization: FancyCategory => fancy_categories
- replaces :: with underscores: Fancy::Category => fancy_categories
Extlib::Inflection#foreign_key
- adds _id to downcased string: Message => message_id
- demodulizes string first: Admin::Post => post_id
Extlib::Hook
Extlib::Hook explicit hookable method registration
Extlib::Hook explicit hookable method registration for class methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on methods from module extensions
- should allow modules to register hooks in the self.extended method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow advising methods ending in ? or !
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook explicit hookable method registration for instance methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on included module methods
- should allow modules to register hooks in the self.included method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow hooking methods ending in ? or ! with block hooks
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook implicit hookable method registration
Extlib::Hook implicit hookable method registration for class methods
- should implicitly register the method as hookable
Extlib::Hook implicit hookable method registration for instance methods
- should implicitly register the method as hookable
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook method registration
Extlib::Hook hook method registration for class methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook method registration for instance methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook invocation without inheritance
Extlib::Hook hook invocation without inheritance for class methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation without inheritance for instance methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should not pass the method return value to the after hook if the method does not take arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation with class inheritance
Extlib::Hook hook invocation with class inheritance for class methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in the parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with class inheritance for instance methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with module inclusions / extensions
Extlib::Hook hook invocation with module inclusions / extensions for class methods
- should not overwrite methods included by extensions after the hook is declared
Extlib::Hook hook invocation with module inclusions / extensions for instance methods
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook invocation with unrelated classes
Extlib::Hook hook invocation with unrelated classes for class methods
- should not execute hooks registered in an unrelated class
Extlib::Hook hook invocation with unrelated classes for instance methods
- should not execute hooks registered in an unrelated class
Extlib::Hook using before hook
Extlib::Hook using before hook for class methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using before hook for instance methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using after hook
Extlib::Hook using after hook for class methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook using after hook for instance methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should return nil if an after hook throws :halt without a return value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook aborting
Extlib::Hook aborting for class methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
- should return nil if an after hook throws :halt without a return value
Extlib::Hook aborting for instance methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
Extlib::Hook aborting with return values
Extlib::Hook aborting with return values for class methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook aborting with return values for instance methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook helper methods
- should generate the correct argument signature
Hash environmentize_keys!
- should transform keys to uppercase text
- should only transform one level of keys
Hash only
- should return a hash with only the given key(s)
Hash except
- should return a hash without only the given key(s)
Hash to_xml_attributes
- should turn the hash into xml attributes
- should preserve _ in hash keys
Hash from_xml
- should transform a simple tag with content
- should work with cdata tags
- should transform a simple tag with attributes
- should transform repeating siblings into an array
- should not transform non-repeating siblings into an array
- should typecast an integer
- should typecast a true boolean
- should typecast a false boolean
- should typecast a datetime
- should typecast a date
- should unescape html entities
- should undasherize keys as tags
- should undasherize keys as attributes
- should undasherize keys as tags and attributes
- should render nested content correctly
- should render nested content with split text nodes correctly
- should ignore attributes when a child is a text node
- should ignore attributes when any child is a text node
- should correctly transform multiple children
- should properly handle nil values (ActiveSupport Compatible)
- should handle a single record from xml (ActiveSupport Compatible)
- should handle multiple records (ActiveSupport Compatible)
- should handle a single record from_xml with attributes other than type (ActiveSupport Compatible)
- should handle an emtpy array (ActiveSupport Compatible)
- should handle empty array with whitespace from xml (ActiveSupport Compatible)
- should handle array with one entry from_xml (ActiveSupport Compatible)
- should handle array with multiple entries from xml (ActiveSupport Compatible)
- should handle file types (ActiveSupport Compatible)
- should handle file from xml with defaults (ActiveSupport Compatible)
- should handle xsd like types from xml (ActiveSupport Compatible)
- should let type trickle through when unknown (ActiveSupport Compatible)
- should handle unescaping from xml (ActiveResource Compatible)
Hash to_params
- should covert hash: {"foo"=>{"1"=>"bar", "2"=>"baz"}} to params: "foo[1]=bar&foo[2]=baz"
- should covert hash: {"baz"=>"bat", "foo"=>"bar"} to params: "foo=bar&baz=bat"
- should covert hash: {"foo"=>{"bar"=>[{"baz"=>1}, {"baz"=>"2"}]}} to params: "foo[bar][][baz]=1&foo[bar][][baz]=2"
- should covert hash: {"foo"=>["bar", "baz"]} to params: "foo[]=bar&foo[]=baz"
- should covert hash: {"foo"=>[{"bar"=>"1"}, {"bar"=>2}]} to params: "foo[][bar]=1&foo[][bar]=2"
- should not leave a trailing &
Hash to_mash
- copies default Hash value to Mash
Struct
- should have attributes
LazyArray
- should provide #at
- should provide #clear
- should provide #collect!
- should provide #concat
- should provide #delete
- should provide #delete_at
- should provide #dup
- should provide #each
- should provide #each_index
- should provide #empty?
- should provide #entries
- should provide #freeze
- should provide #eql?
- should provide #fetch
- should provide #first
- should provide #index
- should provide #insert
- should provide #last
- should provide #length
- should provide #loaded?
- should provide #partition
- should provide #pop
- should provide #push
- should provide #reject
- should provide #reject!
- should provide #replace
- should provide #reverse
- should provide #reverse!
- should provide #reverse_each
- should provide #rindex
- should provide #select
- should provide #shift
- should provide #slice
- should provide #slice!
- should provide #sort
- should provide #sort!
- should provide #to_a
- should provide #to_ary
- should provide #to_proc
- should provide #unload
- should provide #unshift
- should provide #values_at
LazyArray#at
- should delegate to the array and return the results directly
- should lookup the entry by index
LazyArray#clear
- should delegate to the array and return self
- should return self
- should make the lazy array become empty
- should be loaded afterwards
LazyArray#collect!
- should delegate to the array and return self
- should return self
- should iterate over the lazy array
- should update the lazy array with the result of the block
LazyArray#concat
- should delegate to the array and return self
- should return self
- should concatenate another lazy array with #concat
LazyArray#delete
- should delegate to the array and return the results directly
- should delete the matching entry from the lazy array
- should use the passed-in block when no entry was removed
LazyArray#delete_at
- should delegate to the array and return the results directly
- should delete the entry from the lazy array with the index
LazyArray#dup
- should delegate to the array and return the results directly
- should copy the original array
- should copy the original load proc
LazyArray#each
- should delegate to the array and return self
- should return self
- should iterate over the lazy array entries
LazyArray#each_index
- should delegate to the array and return self
- should return self
- should iterate over the lazy array by index
LazyArray#empty?
- should delegate to the array and return the results directly
- should return true if the lazy array has entries
- should return false if the lazy array has no entries
LazyArray#entries
- should delegate to the array and return the results directly
- should return an Array
LazyArray#freeze
- should delegate to the array and return self
- should freeze the underlying array
LazyArray#eql?
- should delegate to the array and return the results directly
- should return true if for the same lazy array
- should return true for duplicate lazy arrays
- should return false for different lazy arrays
LazyArray#fetch
- should delegate to the array and return the results directly
- should lookup the entry with an index
- should throw an IndexError exception if the index is outside the array
- should substitute the default if the index is outside the array
- should substitute the value returned by the default block if the index is outside the array
LazyArray#first
- should delegate to the array and return the results directly
LazyArray#first with no arguments
- should return the first entry in the lazy array
LazyArray#first with number of results specified
- should return an Array
LazyArray#index
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the first matching entry in the lazy array
LazyArray#insert
- should delegate to the array and return self
- should return self
- should insert the entry at index in the lazy array
LazyArray#last
- should delegate to the array and return the results directly
LazyArray#last with no arguments
- should return the last entry in the lazy array
LazyArray#last with number of results specified
- should return an Array
LazyArray#length
- should delegate to the array and return the results directly
- should return an Integer
- should return the length of the lazy array
LazyArray#loaded?
- should return true for an initialized lazy array
- should return false for an uninitialized lazy array
LazyArray#partition
LazyArray#partition return value
- should be an Array
- should have two entries
LazyArray#partition return value first entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#partition return value second entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#pop
- should delegate to the array and return the results directly
- should remove the last entry
LazyArray#push
- should delegate to the array and return self
- should return self
- should append an entry
LazyArray#reject
- should delegate to the array and return the results directly
- should return an Array with entries that did not match the block
- should return an empty Array if entries matched the block
LazyArray#reject!
- should delegate to the array and return self
- should return self if entries matched the block
- should return nil if no entries matched the block
- should remove entries that matched the block
- should not remove entries that did not match the block
LazyArray#replace
- should delegate to the array and return self
- should return self
- should replace itself with the other object
- should be loaded afterwards
LazyArray#reverse
- should delegate to the array and return the results directly
- should return an Array with reversed entries
LazyArray#reverse!
- should delegate to the array and return self
- should return self
- should reverse the order of entries in the lazy array inline
LazyArray#reverse_each
- should delegate to the array and return self
- should return self
- should iterate through the lazy array in reverse
LazyArray#rindex
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the last matching entry in the lazy array
LazyArray#select
- should delegate to the array and return the results directly
- should return an Array with entries that matched the block
- should return an empty Array if no entries matched the block
LazyArray#shift
- should delegate to the array and return the results directly
- should remove the first entry
LazyArray#slice
- should delegate to the array and return the results directly
LazyArray#slice with an index
- should not modify the lazy array
LazyArray#slice with a start and length
- should return an Array
- should not modify the lazy array
LazyArray#slice with a Range
- should return an Array
- should not modify the lazy array
LazyArray#slice!
- should delegate to the array and return the results directly
LazyArray#slice! with an index
- should modify the lazy array
LazyArray#slice! with a start and length
- should return an Array
- should modify the lazy array
LazyArray#slice! with a Range
- should return an Array
- should modify the lazy array
LazyArray#sort
- should delegate to the array and return the results directly
- should return an Array
- should sort the entries
LazyArray#sort!
- should delegate to the array and return self
- should return self
- should sort the LazyArray in place
LazyArray#to_a
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_ary
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_proc
- should return a Prox
- should return the proc supplied to load_with
LazyArray#unload
- should return self
- should make the lazy array become empty
- should not be loaded afterwards
LazyArray#unshift
- should delegate to the array and return self
- should return self
- should prepend an entry
LazyArray#values_at
- should delegate to the array and return the results directly
- should return an Array
- should return an Array of the entries at the index
LazyArray a method mixed into Array
- should delegate to the Array
LazyArray an unknown method
- should raise an exception
try_dup
- returns a duplicate version on regular objects
- returns self on Numerics
- returns self on Symbols
- returns self on true
- returns self on false
- returns self on nil
- returns self on modules
Module
- should raise NameError for a missing constant
- should be able to get a recursive constant
- should ignore get Constants from the Kernel namespace correctly
- should find relative constants
- should find sibling constants
- should find nested constants on nested constants
- should be able to deal with constants being added and removed
DateTime#to_time
- should return a copy of time
Time#to_datetime
- should return a copy of its self
VirtualFile
- inherits from StringIO
- has path reader
- has path writer
Extlib::Inflection#singular
- pluralizes equipment => equipment
- pluralizes information => information
- pluralizes money => money
- pluralizes species => species
- pluralizes series => series
- pluralizes fish => fish
- pluralizes sheep => sheep
- pluralizes news => news
- pluralizes rain => rain
- pluralizes milk => milk
- pluralizes moose => moose
- pluralizes hovercraft => hovercraft
- pluralizes cacti => cactus
- pluralizes thesaurus => thesauri
- pluralizes matrix => matrices
- pluralizes Swiss => Swiss
- pluralizes life => lives
- pluralizes wife => wives
- pluralizes goose => geese
- pluralizes criterion => criteria
- pluralizes alias => aliases
- pluralizes status => statuses
- pluralizes axis => axes
- pluralizes crisis => crises
- pluralizes testis => testes
- pluralizes child => children
- pluralizes person => people
- pluralizes potato => potatoes
- pluralizes tomato => tomatoes
- pluralizes buffalo => buffaloes
- pluralizes torpedo => torpedoes
- pluralizes quiz => quizzes
- pluralizes vertex => vertices
- pluralizes index => indices
- pluralizes ox => oxen
- pluralizes mouse => mice
- pluralizes louse => lice
- pluralizes thesis => theses
- pluralizes thief => thieves
- pluralizes analysis => analyses
- pluralizes octopus => octopi
- pluralizes grass => grass
- pluralizes phenomenon => phenomena
- pluralizes forum => forums
- pluralizes hive => hives
- pluralizes athlete => athletes
- pluralizes dwarf => dwarves
- pluralizes hero => heroes
- pluralizes zero => zeroes
- pluralizes man => men
- pluralizes woman => women
- pluralizes sportsman => sportsmen
- pluralizes branch => branches
- pluralizes crunch => crunches
- pluralizes trash => trashes
- pluralizes mash => mashes
- pluralizes cross => crosses
- pluralizes erratum => errata
- pluralizes ray => rays
- pluralizes spray => sprays
- pluralizes prey => preys
- pluralizes toy => toys
- pluralizes joy => joys
- pluralizes buy => buys
- pluralizes guy => guys
- pluralizes cry => cries
- pluralizes fly => flies
- pluralizes fox => foxes
- pluralizes elf => elves
- pluralizes shelf => shelves
- pluralizes plus => plusses
- pluralizes cat => cats
- pluralizes rat => rats
- pluralizes rose => roses
- pluralizes project => projects
- pluralizes post => posts
- pluralizes article => articles
- pluralizes location => locations
- pluralizes friend => friends
- pluralizes link => links
- pluralizes url => urls
- pluralizes account => accounts
- pluralizes server => servers
- pluralizes fruit => fruits
- pluralizes map => maps
- pluralizes income => incomes
- pluralizes ping => pings
- pluralizes event => events
- pluralizes proof => proofs
- pluralizes typo => typos
- pluralizes attachment => attachments
- pluralizes download => downloads
- pluralizes asset => assets
- pluralizes job => jobs
- pluralizes city => cities
- pluralizes package => packages
- pluralizes commit => commits
- pluralizes version => versions
- pluralizes document => documents
- pluralizes edition => editions
- pluralizes movie => movies
- pluralizes song => songs
- pluralizes invoice => invoices
- pluralizes product => products
- pluralizes book => books
- pluralizes ticket => tickets
- pluralizes game => games
- pluralizes tournament => tournaments
- pluralizes prize => prizes
- pluralizes price => prices
- pluralizes installation => installations
- pluralizes date => dates
- pluralizes schedule => schedules
- pluralizes arena => arenas
- pluralizes spam => spams
- pluralizes bus => buses
- pluralizes rice => rice
- pluralizes cow => kine
- pluralizes edge => edges
- pluralizes horse => horses
- pluralizes shoe => shoes
- pluralizes virus => viruses
- pluralizes photo => photos
- pluralizes old_news => old_news
- pluralizes wish => wishes
- pluralizes box => boxes
- pluralizes portfolio => portfolios
- pluralizes diagnosis_a => diagnosis_as
- pluralizes basis => bases
- pluralizes salesperson => salespeople
- pluralizes category => categories
- pluralizes stack => stacks
- pluralizes search => searches
- pluralizes matrix_fu => matrix_fus
- pluralizes node_child => node_children
- pluralizes safe => saves
- pluralizes archive => archives
- pluralizes switch => switches
- pluralizes medium => media
- pluralizes house => houses
- pluralizes datum => data
- pluralizes process => processes
- pluralizes axis => axes
- pluralizes agency => agencies
- pluralizes case => cases
- pluralizes perspective => perspectives
- pluralizes foobar => foobars
- pluralizes day => days
- pluralizes move => moves
- pluralizes newsletter => newsletters
- pluralizes status_code => status_codes
- pluralizes spokesman => spokesmen
- pluralizes half => halves
- pluralizes query => queries
- pluralizes comment => comments
- pluralizes address => addresses
- pluralizes experience => experiences
- pluralizes diagnosis => diagnoses
- pluralizes ability => abilities
- pluralizes fix => fixes
Extlib::Inflection#singular
- singularizes equipment => equipment
- singularizes postgres => postgres
- singularizes mysql => mysql
- singularizes information => information
- singularizes money => money
- singularizes species => species
- singularizes series => series
- singularizes fish => fish
- singularizes sheep => sheep
- singularizes news => news
- singularizes rain => rain
- singularizes milk => milk
- singularizes moose => moose
- singularizes hovercraft => hovercraft
- singularizes cactus => cacti
- singularizes thesauri => thesaurus
- singularizes matrices => matrix
- singularizes Swiss => Swiss
- singularizes lives => life
- singularizes wives => wife
- singularizes geese => goose
- singularizes criteria => criterion
- singularizes aliases => alias
- singularizes statuses => status
- singularizes axes => axis
- singularizes crises => crisis
- singularizes testes => testis
- singularizes children => child
- singularizes people => person
- singularizes potatoes => potato
- singularizes tomatoes => tomato
- singularizes buffaloes => buffalo
- singularizes torpedoes => torpedo
- singularizes quizzes => quiz
- singularizes vertices => vertex
- singularizes indices => index
- singularizes oxen => ox
- singularizes mice => mouse
- singularizes lice => louse
- singularizes theses => thesis
- singularizes thieves => thief
- singularizes analyses => analysis
- singularizes octopi => octopus
- singularizes grass => grass
- singularizes phenomena => phenomenon
- singularizes forums => forum
- singularizes hives => hive
- singularizes athletes => athlete
- singularizes dwarves => dwarf
- singularizes heroes => hero
- singularizes zeroes => zero
- singularizes men => man
- singularizes women => woman
- singularizes sportsmen => sportsman
- singularizes branches => branch
- singularizes crunches => crunch
- singularizes trashes => trash
- singularizes mashes => mash
- singularizes crosses => cross
- singularizes errata => erratum
- singularizes rays => ray
- singularizes sprays => spray
- singularizes preys => prey
- singularizes toys => toy
- singularizes joys => joy
- singularizes buys => buy
- singularizes guys => guy
- singularizes cries => cry
- singularizes flies => fly
- singularizes foxes => fox
- singularizes elves => elf
- singularizes shelves => shelf
- singularizes pluses => plus
- singularizes cats => cat
- singularizes rats => rat
- singularizes roses => rose
- singularizes projects => project
- singularizes posts => post
- singularizes articles => article
- singularizes locations => location
- singularizes friends => friend
- singularizes links => link
- singularizes urls => url
- singularizes accounts => account
- singularizes servers => server
- singularizes fruits => fruit
- singularizes maps => map
- singularizes incomes => income
- singularizes pings => ping
- singularizes events => event
- singularizes proofs => proof
- singularizes typos => typo
- singularizes attachments => attachment
- singularizes downloads => download
- singularizes assets => asset
- singularizes jobs => job
- singularizes cities => city
- singularizes packages => package
- singularizes commits => commit
- singularizes versions => version
- singularizes documents => document
- singularizes editions => edition
- singularizes movies => movie
- singularizes songs => song
- singularizes invoices => invoice
- singularizes products => product
- singularizes books => book
- singularizes tickets => ticket
- singularizes games => game
- singularizes tournaments => tournament
- singularizes prizes => prize
- singularizes prices => price
- singularizes installations => installation
- singularizes dates => date
- singularizes schedules => schedule
- singularizes arenas => arena
- singularizes spams => spam
- singularizes rice => rice
Pending:
String.translations returns @translations if set (is it @translations on metaclass or @@translations? leaving it out for now)
Finished in 2.716063 seconds
770 examples, 0 failures, 1 pending
91.4% 25 file(s) 2702 Lines 1415 LOC
mv /home/dbussink/ci/extlib/coverage /home/dbussink/ci/extlib/ci/coverage
RESULT = 0
VERSION = 1.8.6-p286
CMD = ~/.multiruby/install/1.8.6-p286/bin/ruby /usr/bin/rake ci
(in /home/dbussink/ci/extlib)
rm -rf /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci
mkdir -p /home/dbussink/ci/extlib/ci/doc
mkdir -p /home/dbussink/ci/extlib/ci/cyclomatic
mkdir -p /home/dbussink/ci/extlib/ci/token
rm -r coverage
Time#to_json
- should transform itself into a ISO 8601 compatible string
Time#to_time
- should return a copy of its self
Mash
Mash#initialize
- converts all keys into strings when param is a Hash
- converts all pure Hash values into Mashes if param is a Hash
- doesn not convert Hash subclass values into Mashes
- converts all value items if value is an Array
- delegates to superclass constructor if param is not a Hash
Mash#update
- converts all keys into strings when param is a Hash
- converts all Hash values into Mashes if param is a Hash
Mash#[]=
- converts key into string
- converts all Hash value into Mash
Mash#key?
- converts key before lookup
- is aliased as include?
- is aliased as member?
Mash#dup
- returns instance of Mash
- preserves keys
- preserves value
Mash#to_hash
- returns instance of Mash
- preserves keys
- preserves value
Mash#delete
- converts Symbol key into String before deleting
- works with String keys as well
Mash#except
- converts Symbol key into String before calling super
- works with String keys as well
- works with multiple keys
- should return a mash
Mash#merge
- returns instance of Mash
- merges in give Hash
Mash#fetch
- converts key before fetching
- returns alternative value if key lookup fails
Mash#default
- returns default value unless key exists in mash
- returns existing value if key is Symbol and exists in mash
Mash#values_at
- is indifferent to whether keys are strings or symbols
Mash#stringify_keys!
- returns the mash itself
Object
- should provide blank?
- should be blank if it is nil
- should be blank if it is empty
- should not be blank if not nil or empty
Numeric
- should provide blank?
- should never be blank
NilClass
- should provide blank?
- should always be blank
TrueClass
- should provide blank?
- should never be blank
FalseClass
- should provide blank?
- should always be blank
String
- should provide blank?
- should be blank if empty
- should be blank if it only contains whitespace
- should not be blank if it contains non-whitespace
String#to_const_string
- swaps slashes with ::
- replaces snake_case with CamelCase
- leaves constant string as is
String#to_const_path
- swaps :: with slash
- snake_cases string
- leaves slash-separated snake case string as is
String#camel_case
- handles lowercase without underscore
- handles lowercase with 1 underscore
- handles lowercase with more than 1 underscore
- handles lowercase with more than 1 underscore in a row
- handle first capital letter with underscores
- leaves CamelCase as is
String#snake_case
- lowercases one word CamelCase
- makes one underscore snake_case two word CamelCase
- handles CamelCase with more than 2 words
- handles CamelCase with more than 2 capital letter in a row
- does NOT change one word lowercase
- leaves snake_case as is
String#escape_regexp
- escapes all * in a string
- escapes all ? in a string
- escapes all { in a string
- escapes all } in a string
- escapes all . in a string
- escapes all regexp special characters used in a string
String#unescape_regexp
- unescapes all \* in a string
- unescapes all \? in a string
- unescapes all \{ in a string
- unescapes all \} in a string
- unescapes all \. in a string
- unescapes all regexp special characters used in a string
String#/
- concanates operands with File::SEPARATOR
String#relative_path_from
- uses other operand as base for path calculation
String.translate
- looks up for translation in translations dictionary
- returns string that has no translations as it is
String.t
- looks up for translation in translations dictionary and translates parameters as well
- returns string that has no translations as it is
- should not translate when freezed
String.translations
- returns empty hash by default
- returns @translations if set (PENDING: is it @translations on metaclass or @@translations? leaving it out for now)
Extlib::SimpleSet
- should support <<
- should support merge
- should support inspect
Extlib::Inflection#singular
- pluralizes equipment => equipment
- pluralizes information => information
- pluralizes money => money
- pluralizes species => species
- pluralizes series => series
- pluralizes fish => fish
- pluralizes sheep => sheep
- pluralizes news => news
- pluralizes rain => rain
- pluralizes milk => milk
- pluralizes moose => moose
- pluralizes hovercraft => hovercraft
- pluralizes cacti => cactus
- pluralizes thesaurus => thesauri
- pluralizes matrix => matrices
- pluralizes Swiss => Swiss
- pluralizes life => lives
- pluralizes wife => wives
- pluralizes goose => geese
- pluralizes criterion => criteria
- pluralizes alias => aliases
- pluralizes status => statuses
- pluralizes axis => axes
- pluralizes crisis => crises
- pluralizes testis => testes
- pluralizes child => children
- pluralizes person => people
- pluralizes potato => potatoes
- pluralizes tomato => tomatoes
- pluralizes buffalo => buffaloes
- pluralizes torpedo => torpedoes
- pluralizes quiz => quizzes
- pluralizes vertex => vertices
- pluralizes index => indices
- pluralizes ox => oxen
- pluralizes mouse => mice
- pluralizes louse => lice
- pluralizes thesis => theses
- pluralizes thief => thieves
- pluralizes analysis => analyses
- pluralizes octopus => octopi
- pluralizes grass => grass
- pluralizes phenomenon => phenomena
- pluralizes forum => forums
- pluralizes hive => hives
- pluralizes athlete => athletes
- pluralizes dwarf => dwarves
- pluralizes hero => heroes
- pluralizes zero => zeroes
- pluralizes man => men
- pluralizes woman => women
- pluralizes sportsman => sportsmen
- pluralizes branch => branches
- pluralizes crunch => crunches
- pluralizes trash => trashes
- pluralizes mash => mashes
- pluralizes cross => crosses
- pluralizes erratum => errata
- pluralizes ray => rays
- pluralizes spray => sprays
- pluralizes prey => preys
- pluralizes toy => toys
- pluralizes joy => joys
- pluralizes buy => buys
- pluralizes guy => guys
- pluralizes cry => cries
- pluralizes fly => flies
- pluralizes fox => foxes
- pluralizes elf => elves
- pluralizes shelf => shelves
- pluralizes plus => plusses
- pluralizes cat => cats
- pluralizes rat => rats
- pluralizes rose => roses
- pluralizes project => projects
- pluralizes post => posts
- pluralizes article => articles
- pluralizes location => locations
- pluralizes friend => friends
- pluralizes link => links
- pluralizes url => urls
- pluralizes account => accounts
- pluralizes server => servers
- pluralizes fruit => fruits
- pluralizes map => maps
- pluralizes income => incomes
- pluralizes ping => pings
- pluralizes event => events
- pluralizes proof => proofs
- pluralizes typo => typos
- pluralizes attachment => attachments
- pluralizes download => downloads
- pluralizes asset => assets
- pluralizes job => jobs
- pluralizes city => cities
- pluralizes package => packages
- pluralizes commit => commits
- pluralizes version => versions
- pluralizes document => documents
- pluralizes edition => editions
- pluralizes movie => movies
- pluralizes song => songs
- pluralizes invoice => invoices
- pluralizes product => products
- pluralizes book => books
- pluralizes ticket => tickets
- pluralizes game => games
- pluralizes tournament => tournaments
- pluralizes prize => prizes
- pluralizes price => prices
- pluralizes installation => installations
- pluralizes date => dates
- pluralizes schedule => schedules
- pluralizes arena => arenas
- pluralizes spam => spams
- pluralizes bus => buses
- pluralizes rice => rice
- pluralizes cow => kine
- pluralizes edge => edges
- pluralizes horse => horses
- pluralizes shoe => shoes
- pluralizes virus => viruses
- pluralizes photo => photos
- pluralizes old_news => old_news
- pluralizes wish => wishes
- pluralizes box => boxes
- pluralizes portfolio => portfolios
- pluralizes diagnosis_a => diagnosis_as
- pluralizes basis => bases
- pluralizes salesperson => salespeople
- pluralizes category => categories
- pluralizes stack => stacks
- pluralizes search => searches
- pluralizes matrix_fu => matrix_fus
- pluralizes node_child => node_children
- pluralizes safe => saves
- pluralizes archive => archives
- pluralizes switch => switches
- pluralizes medium => media
- pluralizes house => houses
- pluralizes datum => data
- pluralizes process => processes
- pluralizes axis => axes
- pluralizes agency => agencies
- pluralizes case => cases
- pluralizes perspective => perspectives
- pluralizes foobar => foobars
- pluralizes day => days
- pluralizes move => moves
- pluralizes newsletter => newsletters
- pluralizes status_code => status_codes
- pluralizes spokesman => spokesmen
- pluralizes half => halves
- pluralizes query => queries
- pluralizes comment => comments
- pluralizes address => addresses
- pluralizes experience => experiences
- pluralizes diagnosis => diagnoses
- pluralizes ability => abilities
- pluralizes fix => fixes
Extlib::Inflection#singular
- singularizes equipment => equipment
- singularizes postgres => postgres
- singularizes mysql => mysql
- singularizes information => information
- singularizes money => money
- singularizes species => species
- singularizes series => series
- singularizes fish => fish
- singularizes sheep => sheep
- singularizes news => news
- singularizes rain => rain
- singularizes milk => milk
- singularizes moose => moose
- singularizes hovercraft => hovercraft
- singularizes cactus => cacti
- singularizes thesauri => thesaurus
- singularizes matrices => matrix
- singularizes Swiss => Swiss
- singularizes lives => life
- singularizes wives => wife
- singularizes geese => goose
- singularizes criteria => criterion
- singularizes aliases => alias
- singularizes statuses => status
- singularizes axes => axis
- singularizes crises => crisis
- singularizes testes => testis
- singularizes children => child
- singularizes people => person
- singularizes potatoes => potato
- singularizes tomatoes => tomato
- singularizes buffaloes => buffalo
- singularizes torpedoes => torpedo
- singularizes quizzes => quiz
- singularizes vertices => vertex
- singularizes indices => index
- singularizes oxen => ox
- singularizes mice => mouse
- singularizes lice => louse
- singularizes theses => thesis
- singularizes thieves => thief
- singularizes analyses => analysis
- singularizes octopi => octopus
- singularizes grass => grass
- singularizes phenomena => phenomenon
- singularizes forums => forum
- singularizes hives => hive
- singularizes athletes => athlete
- singularizes dwarves => dwarf
- singularizes heroes => hero
- singularizes zeroes => zero
- singularizes men => man
- singularizes women => woman
- singularizes sportsmen => sportsman
- singularizes branches => branch
- singularizes crunches => crunch
- singularizes trashes => trash
- singularizes mashes => mash
- singularizes crosses => cross
- singularizes errata => erratum
- singularizes rays => ray
- singularizes sprays => spray
- singularizes preys => prey
- singularizes toys => toy
- singularizes joys => joy
- singularizes buys => buy
- singularizes guys => guy
- singularizes cries => cry
- singularizes flies => fly
- singularizes foxes => fox
- singularizes elves => elf
- singularizes shelves => shelf
- singularizes pluses => plus
- singularizes cats => cat
- singularizes rats => rat
- singularizes roses => rose
- singularizes projects => project
- singularizes posts => post
- singularizes articles => article
- singularizes locations => location
- singularizes friends => friend
- singularizes links => link
- singularizes urls => url
- singularizes accounts => account
- singularizes servers => server
- singularizes fruits => fruit
- singularizes maps => map
- singularizes incomes => income
- singularizes pings => ping
- singularizes events => event
- singularizes proofs => proof
- singularizes typos => typo
- singularizes attachments => attachment
- singularizes downloads => download
- singularizes assets => asset
- singularizes jobs => job
- singularizes cities => city
- singularizes packages => package
- singularizes commits => commit
- singularizes versions => version
- singularizes documents => document
- singularizes editions => edition
- singularizes movies => movie
- singularizes songs => song
- singularizes invoices => invoice
- singularizes products => product
- singularizes books => book
- singularizes tickets => ticket
- singularizes games => game
- singularizes tournaments => tournament
- singularizes prizes => prize
- singularizes prices => price
- singularizes installations => installation
- singularizes dates => date
- singularizes schedules => schedule
- singularizes arenas => arena
- singularizes spams => spam
- singularizes rice => rice
Symbol#/
- concanates operands with File::SEPARATOR
Extlib::Pooling
- should track the initialized pools
- should maintain a size of 1
- should allow you to overwrite Class#new
- should raise a ThreadStopError when the pool is exhausted in a single thread
- should allow multiple threads to access the pool
- should allow you to flush a pool
- should wake up the scavenger thread when exiting
ObjectSpace#classes
- returns only classes, nothing else
Class#inheritable_accessor
- inherits from parent unless overriden
- inherits from grandparent unless overriden
- inherits even if the accessor is made after the inheritance
- supports ||= to change a child
- supports << to change a child when the parent is an Array
- supports ! methods on an Array
- support modifying a parent Hash
- supports hard-merging a parent Hash
- supports changes to the parent even if the child has already been read
- handles nil being set midstream
- handles false being used in Parent
- handles the grandparent changing the value (as long as the child isn't read first)
Object
Object#full_const_get
- returns constant by FQ name in receiver namespace
Object#full_const_set
- sets constant value by FQ name in receiver namespace
Object#make_module
- creates a module from string FQ name
- handles the case where we already have a class in the heirarchy
Object#quacks_like?
- returns true if duck is a Symbol and receiver responds to it
- returns false if duck is a Symbol and receiver DOES NOT respond to it
- returns true if duck is a class and receiver is its instance
- returns false if duck is a class and receiver IS NOT its instance
- returns true if duck is an array and at least one of its members quacks like this duck
- returns false if duck is an array and none of its members quacks like this duck
Object#in?
- returns true if object is included in collection
Object#encoded_hash
- returns the encoded hash like the value in the default Object#inspect
Extlib::Inflection
Extlib::Inflection#classify
- classifies data_mapper as DataMaper
- singularizes string first: classifies data_mappers as egg_and_hams as EggAndHam
Extlib::Inflection#camelize
- camelizes data_mapper as DataMapper
- camelizes merb as Merb
- camelizes data_mapper/resource as DataMapper::Resource
- camelizes data_mapper/associations/one_to_many as DataMapper::Associations::OneToMany
Extlib::Inflection#underscore
- underscores DataMapper as data_mapper
- underscores Merb as merb
- underscores DataMapper::Resource as data_mapper/resource
- underscores Merb::BootLoader::Rackup as merb/boot_loader/rackup
Extlib::Inflection#humanize
- replaces _ with space: humanizes employee_salary as Employee salary
- strips _id endings: humanizes author_id as Author
Extlib::Inflection#demodulize
- demodulizes module name: DataMapper::Inflector => Inflector
- demodulizes module name: A::B::C::D::E => E
Extlib::Inflection#tableize
- pluralizes last word in snake_case strings: fancy_category => fancy_categories
- underscores CamelCase strings before pluralization: FancyCategory => fancy_categories
- replaces :: with underscores: Fancy::Category => fancy_categories
Extlib::Inflection#foreign_key
- adds _id to downcased string: Message => message_id
- demodulizes string first: Admin::Post => post_id
Extlib::Hook
Extlib::Hook explicit hookable method registration
Extlib::Hook explicit hookable method registration for class methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on methods from module extensions
- should allow modules to register hooks in the self.extended method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow advising methods ending in ? or !
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook explicit hookable method registration for instance methods
- shouldn't confuse instance method hooks and class method hooks
- should be able to register multiple hookable methods at once
- should not allow a method that does not exist to be registered as hookable
- should allow hooks to be registered on included module methods
- should allow modules to register hooks in the self.included method
- should be able to register protected methods as hooks
- should not be able to register private methods as hooks
- should allow hooking methods ending in ? or ! with block hooks
- should allow hooking methods ending in ?, ! or = with method hooks
- should allow hooking methods that have single character names
Extlib::Hook implicit hookable method registration
Extlib::Hook implicit hookable method registration for class methods
- should implicitly register the method as hookable
Extlib::Hook implicit hookable method registration for instance methods
- should implicitly register the method as hookable
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook method registration
Extlib::Hook hook method registration for class methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook method registration for instance methods
- should complain when only one argument is passed
- should complain when target_method is not a symbol
- should complain when method_sym is not a symbol
- should not allow methods ending in = to be hooks
Extlib::Hook hook invocation without inheritance
Extlib::Hook hook invocation without inheritance for class methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation without inheritance for instance methods
- should run an advice block
- should run an advice method
- should not pass any of the hookable method's arguments if the hook block does not accept arguments
- should not pass any of the hookable method's arguments if the hook method does not accept arguments
- should not pass any of the hookable method's arguments if the hook is declared after it is registered and does not accept arguments
- should not pass any of the hookable method's arguments if the hook has been re-defined not to accept arguments
- should pass the hookable method arguments to the hook method if the hook method takes arguments
- should pass the hookable method arguments to the hook block if the hook block takes arguments
- should pass the hookable method arguments to the hook method if the hook method was re-defined to accept arguments
- should not pass the method return value to the after hook if the method does not take arguments
- should work with glob arguments (or whatever you call em)
- should allow the use of before and after together
- should be able to use private methods as hooks
Extlib::Hook hook invocation with class inheritance
Extlib::Hook hook invocation with class inheritance for class methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in the parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with class inheritance for instance methods
- should run an advice block when the class is inherited
- should run an advice block on child class when hook is registered in parent after inheritance
- should be able to declare advice methods in child classes
- should not execute hooks added in the child classes when in parent class
- should not call the hook stack if the hookable method is overwritten and does not call super
- should not call hooks defined in the child class for a hookable method in a parent if the child overwrites the hookable method without calling super
- should not call hooks defined in child class even if hook method exists in parent
Extlib::Hook hook invocation with module inclusions / extensions
Extlib::Hook hook invocation with module inclusions / extensions for class methods
- should not overwrite methods included by extensions after the hook is declared
Extlib::Hook hook invocation with module inclusions / extensions for instance methods
- should not overwrite methods included by modules after the hook is declared
Extlib::Hook hook invocation with unrelated classes
Extlib::Hook hook invocation with unrelated classes for class methods
- should not execute hooks registered in an unrelated class
Extlib::Hook hook invocation with unrelated classes for instance methods
- should not execute hooks registered in an unrelated class
Extlib::Hook using before hook
Extlib::Hook using before hook for class methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using before hook for instance methods
- should run the advice before the advised method
- should execute all advices once in order
Extlib::Hook using after hook
Extlib::Hook using after hook for class methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook using after hook for instance methods
- should run the advice after the advised method
- should execute all advices once in order
- the advised method should still return its normal value
- should return nil if an after hook throws :halt without a return value
- should pass the return value to a hook method
- should pass the return value to a hook block
- should pass the return value and method arguments to a hook block
Extlib::Hook aborting
Extlib::Hook aborting for class methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
- should return nil if an after hook throws :halt without a return value
Extlib::Hook aborting for instance methods
- should catch :halt from a before hook and abort the advised method
- should not run after hooks if a before hook throws :halt
- should return nil from the hookable method if a before hook throws :halt
- should catch :halt from an after hook and cease the advice
Extlib::Hook aborting with return values
Extlib::Hook aborting with return values for class methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook aborting with return values for instance methods
- should be able to abort from a before hook with a return value
- should be able to abort from an after hook with a return value
Extlib::Hook helper methods
- should generate the correct argument signature
Hash environmentize_keys!
- should transform keys to uppercase text
- should only transform one level of keys
Hash only
- should return a hash with only the given key(s)
Hash except
- should return a hash without only the given key(s)
Hash to_xml_attributes
- should turn the hash into xml attributes
- should preserve _ in hash keys
Hash from_xml
- should transform a simple tag with content
- should work with cdata tags
- should transform a simple tag with attributes
- should transform repeating siblings into an array
- should not transform non-repeating siblings into an array
- should typecast an integer
- should typecast a true boolean
- should typecast a false boolean
- should typecast a datetime
- should typecast a date
- should unescape html entities
- should undasherize keys as tags
- should undasherize keys as attributes
- should undasherize keys as tags and attributes
- should render nested content correctly
- should render nested content with split text nodes correctly
- should ignore attributes when a child is a text node
- should ignore attributes when any child is a text node
- should correctly transform multiple children
- should properly handle nil values (ActiveSupport Compatible)
- should handle a single record from xml (ActiveSupport Compatible)
- should handle multiple records (ActiveSupport Compatible)
- should handle a single record from_xml with attributes other than type (ActiveSupport Compatible)
- should handle an emtpy array (ActiveSupport Compatible)
- should handle empty array with whitespace from xml (ActiveSupport Compatible)
- should handle array with one entry from_xml (ActiveSupport Compatible)
- should handle array with multiple entries from xml (ActiveSupport Compatible)
- should handle file types (ActiveSupport Compatible)
- should handle file from xml with defaults (ActiveSupport Compatible)
- should handle xsd like types from xml (ActiveSupport Compatible)
- should let type trickle through when unknown (ActiveSupport Compatible)
- should handle unescaping from xml (ActiveResource Compatible)
Hash to_params
- should covert hash: {"foo"=>{"1"=>"bar", "2"=>"baz"}} to params: "foo[1]=bar&foo[2]=baz"
- should covert hash: {"foo"=>[{"bar"=>"1"}, {"bar"=>2}]} to params: "foo[][bar]=1&foo[][bar]=2"
- should covert hash: {"foo"=>{"bar"=>[{"baz"=>1}, {"baz"=>"2"}]}} to params: "foo[bar][][baz]=1&foo[bar][][baz]=2"
- should covert hash: {"foo"=>["bar", "baz"]} to params: "foo[]=bar&foo[]=baz"
- should covert hash: {"baz"=>"bat", "foo"=>"bar"} to params: "foo=bar&baz=bat"
- should not leave a trailing &
Hash to_mash
- copies default Hash value to Mash
Struct
- should have attributes
LazyArray
- should provide #at
- should provide #clear
- should provide #collect!
- should provide #concat
- should provide #delete
- should provide #delete_at
- should provide #dup
- should provide #each
- should provide #each_index
- should provide #empty?
- should provide #entries
- should provide #freeze
- should provide #eql?
- should provide #fetch
- should provide #first
- should provide #index
- should provide #insert
- should provide #last
- should provide #length
- should provide #loaded?
- should provide #partition
- should provide #pop
- should provide #push
- should provide #reject
- should provide #reject!
- should provide #replace
- should provide #reverse
- should provide #reverse!
- should provide #reverse_each
- should provide #rindex
- should provide #select
- should provide #shift
- should provide #slice
- should provide #slice!
- should provide #sort
- should provide #sort!
- should provide #to_a
- should provide #to_ary
- should provide #to_proc
- should provide #unload
- should provide #unshift
- should provide #values_at
LazyArray#at
- should delegate to the array and return the results directly
- should lookup the entry by index
LazyArray#clear
- should delegate to the array and return self
- should return self
- should make the lazy array become empty
- should be loaded afterwards
LazyArray#collect!
- should delegate to the array and return self
- should return self
- should iterate over the lazy array
- should update the lazy array with the result of the block
LazyArray#concat
- should delegate to the array and return self
- should return self
- should concatenate another lazy array with #concat
LazyArray#delete
- should delegate to the array and return the results directly
- should delete the matching entry from the lazy array
- should use the passed-in block when no entry was removed
LazyArray#delete_at
- should delegate to the array and return the results directly
- should delete the entry from the lazy array with the index
LazyArray#dup
- should delegate to the array and return the results directly
- should copy the original array
- should copy the original load proc
LazyArray#each
- should delegate to the array and return self
- should return self
- should iterate over the lazy array entries
LazyArray#each_index
- should delegate to the array and return self
- should return self
- should iterate over the lazy array by index
LazyArray#empty?
- should delegate to the array and return the results directly
- should return true if the lazy array has entries
- should return false if the lazy array has no entries
LazyArray#entries
- should delegate to the array and return the results directly
- should return an Array
LazyArray#freeze
- should delegate to the array and return self
- should freeze the underlying array
LazyArray#eql?
- should delegate to the array and return the results directly
- should return true if for the same lazy array
- should return true for duplicate lazy arrays
- should return false for different lazy arrays
LazyArray#fetch
- should delegate to the array and return the results directly
- should lookup the entry with an index
- should throw an IndexError exception if the index is outside the array
- should substitute the default if the index is outside the array
- should substitute the value returned by the default block if the index is outside the array
LazyArray#first
- should delegate to the array and return the results directly
LazyArray#first with no arguments
- should return the first entry in the lazy array
LazyArray#first with number of results specified
- should return an Array
LazyArray#index
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the first matching entry in the lazy array
LazyArray#insert
- should delegate to the array and return self
- should return self
- should insert the entry at index in the lazy array
LazyArray#last
- should delegate to the array and return the results directly
LazyArray#last with no arguments
- should return the last entry in the lazy array
LazyArray#last with number of results specified
- should return an Array
LazyArray#length
- should delegate to the array and return the results directly
- should return an Integer
- should return the length of the lazy array
LazyArray#loaded?
- should return true for an initialized lazy array
- should return false for an uninitialized lazy array
LazyArray#partition
LazyArray#partition return value
- should be an Array
- should have two entries
LazyArray#partition return value first entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#partition return value second entry
- should be an Array
- should have one entry
- should contain the entry the block returned true for
LazyArray#pop
- should delegate to the array and return the results directly
- should remove the last entry
LazyArray#push
- should delegate to the array and return self
- should return self
- should append an entry
LazyArray#reject
- should delegate to the array and return the results directly
- should return an Array with entries that did not match the block
- should return an empty Array if entries matched the block
LazyArray#reject!
- should delegate to the array and return self
- should return self if entries matched the block
- should return nil if no entries matched the block
- should remove entries that matched the block
- should not remove entries that did not match the block
LazyArray#replace
- should delegate to the array and return self
- should return self
- should replace itself with the other object
- should be loaded afterwards
LazyArray#reverse
- should delegate to the array and return the results directly
- should return an Array with reversed entries
LazyArray#reverse!
- should delegate to the array and return self
- should return self
- should reverse the order of entries in the lazy array inline
LazyArray#reverse_each
- should delegate to the array and return self
- should return self
- should iterate through the lazy array in reverse
LazyArray#rindex
- should delegate to the array and return the results directly
- should return an Integer
- should return the index for the last matching entry in the lazy array
LazyArray#select
- should delegate to the array and return the results directly
- should return an Array with entries that matched the block
- should return an empty Array if no entries matched the block
LazyArray#shift
- should delegate to the array and return the results directly
- should remove the first entry
LazyArray#slice
- should delegate to the array and return the results directly
LazyArray#slice with an index
- should not modify the lazy array
LazyArray#slice with a start and length
- should return an Array
- should not modify the lazy array
LazyArray#slice with a Range
- should return an Array
- should not modify the lazy array
LazyArray#slice!
- should delegate to the array and return the results directly
LazyArray#slice! with an index
- should modify the lazy array
LazyArray#slice! with a start and length
- should return an Array
- should modify the lazy array
LazyArray#slice! with a Range
- should return an Array
- should modify the lazy array
LazyArray#sort
- should delegate to the array and return the results directly
- should return an Array
- should sort the entries
LazyArray#sort!
- should delegate to the array and return self
- should return self
- should sort the LazyArray in place
LazyArray#to_a
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_ary
- should delegate to the array and return the results directly
- should return an Array
LazyArray#to_proc
- should return a Prox
- should return the proc supplied to load_with
LazyArray#unload
- should return self
- should make the lazy array become empty
- should not be loaded afterwards
LazyArray#unshift
- should delegate to the array and return self
- should return self
- should prepend an entry
LazyArray#values_at
- should delegate to the array and return the results directly
- should return an Array
- should return an Array of the entries at the index
LazyArray a method mixed into Array
- should delegate to the Array
LazyArray an unknown method
- should raise an exception
try_dup
- returns a duplicate version on regular objects
- returns self on Numerics
- returns self on Symbols
- returns self on true
- returns self on false
- returns self on nil
- returns self on modules
Module
- should raise NameError for a missing constant
- should be able to get a recursive constant
- should ignore get Constants from the Kernel namespace correctly
- should find relative constants
- should find sibling constants
- should find nested constants on nested constants
- should be able to deal with constants being added and removed
DateTime#to_time
- should return a copy of time
Time#to_datetime
- should return a copy of its self
VirtualFile
- inherits from StringIO
- has path reader
- has path writer
Pending:
String.translations returns @translations if set (is it @translations on metaclass or @@translations? leaving it out for now)
Finished in 2.736064 seconds
770 examples, 0 failures, 1 pending
91.3% 25 file(s) 2702 Lines 1415 LOC
mv /home/dbussink/ci/extlib/coverage /home/dbussink/ci/extlib/ci/coverage
RESULT = 0
TOTAL RESULT = 1 failures out of 4
Passed: 1.8.5-p115, 1.8.7-p72, 1.8.6-p286
Failed: 1.9.0-4
dbussink@ey04-s00167 ~/ci/extlib $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment