facets 1.8.49 → 1.8.51
Sign up to get free protection for your applications and to get access to all the features.
- data/PROJECT +4 -1
- data/Rakefile +25 -48
- data/VERSION +1 -1
- data/doc/AUTHORS +1 -0
- data/doc/CHANGES +6 -0
- data/lib/facets/core/kernel/tap.rb +33 -3
- data/lib/facets/more/command.rb +507 -271
- metadata +2 -548
- data/test/lib/facets/core/array/test_at_rand.rb +0 -34
- data/test/lib/facets/core/array/test_delete_unless.rb +0 -28
- data/test/lib/facets/core/array/test_delete_values.rb +0 -28
- data/test/lib/facets/core/array/test_delete_values_at.rb +0 -31
- data/test/lib/facets/core/array/test_first.rb +0 -46
- data/test/lib/facets/core/array/test_head.rb +0 -42
- data/test/lib/facets/core/array/test_last_index.rb +0 -26
- data/test/lib/facets/core/array/test_merge.rb +0 -35
- data/test/lib/facets/core/array/test_mid.rb +0 -33
- data/test/lib/facets/core/array/test_middle.rb +0 -29
- data/test/lib/facets/core/array/test_op_div.rb +0 -27
- data/test/lib/facets/core/array/test_op_fetch.rb +0 -35
- data/test/lib/facets/core/array/test_pad.rb +0 -48
- data/test/lib/facets/core/array/test_pick.rb +0 -40
- data/test/lib/facets/core/array/test_pos.rb +0 -28
- data/test/lib/facets/core/array/test_pot.rb +0 -28
- data/test/lib/facets/core/array/test_pull.rb +0 -28
- data/test/lib/facets/core/array/test_rand_index.rb +0 -29
- data/test/lib/facets/core/array/test_rand_subset.rb +0 -29
- data/test/lib/facets/core/array/test_range.rb +0 -32
- data/test/lib/facets/core/array/test_rotate.rb +0 -36
- data/test/lib/facets/core/array/test_select.rb +0 -28
- data/test/lib/facets/core/array/test_shuffle.rb +0 -35
- data/test/lib/facets/core/array/test_thru.rb +0 -27
- data/test/lib/facets/core/array/test_to_b.rb +0 -27
- data/test/lib/facets/core/array/test_to_h.rb +0 -33
- data/test/lib/facets/core/array/test_to_hash.rb +0 -27
- data/test/lib/facets/core/binding/self/test_of_caller.rb +0 -35
- data/test/lib/facets/core/binding/test___LINE__.rb +0 -43
- data/test/lib/facets/core/binding/test_call_stack.rb +0 -34
- data/test/lib/facets/core/binding/test_called.rb +0 -30
- data/test/lib/facets/core/binding/test_caller.rb +0 -35
- data/test/lib/facets/core/binding/test_defined.rb +0 -34
- data/test/lib/facets/core/binding/test_eval.rb +0 -34
- data/test/lib/facets/core/binding/test_local_variables.rb +0 -34
- data/test/lib/facets/core/binding/test_method_name.rb +0 -34
- data/test/lib/facets/core/binding/test_op_fetch.rb +0 -34
- data/test/lib/facets/core/binding/test_op_store.rb +0 -35
- data/test/lib/facets/core/binding/test_self.rb +0 -34
- data/test/lib/facets/core/class/test_cattr.rb +0 -63
- data/test/lib/facets/core/class/test_descendents.rb +0 -30
- data/test/lib/facets/core/class/test_method_name.rb +0 -26
- data/test/lib/facets/core/class/test_remove_descendents.rb +0 -32
- data/test/lib/facets/core/class/test_unix_path.rb +0 -26
- data/test/lib/facets/core/comparable/test_at_least.rb +0 -34
- data/test/lib/facets/core/comparable/test_clip.rb +0 -44
- data/test/lib/facets/core/comparable/test_cmp.rb +0 -28
- data/test/lib/facets/core/continuation/self/test_create.rb +0 -26
- data/test/lib/facets/core/date/test_days_in_month.rb +0 -30
- data/test/lib/facets/core/date/test_days_of_month.rb +0 -30
- data/test/lib/facets/core/date/test_stamp.rb +0 -38
- data/test/lib/facets/core/date/test_to_date.rb +0 -30
- data/test/lib/facets/core/date/test_to_s.rb +0 -30
- data/test/lib/facets/core/date/test_to_time.rb +0 -30
- data/test/lib/facets/core/dir/self/test_ancestor.rb +0 -26
- data/test/lib/facets/core/dir/self/test_ascend.rb +0 -41
- data/test/lib/facets/core/enumerable/self/test_combinations.rb +0 -46
- data/test/lib/facets/core/enumerable/test_cart.rb +0 -49
- data/test/lib/facets/core/enumerable/test_collect_with_index.rb +0 -27
- data/test/lib/facets/core/enumerable/test_commonality.rb +0 -31
- data/test/lib/facets/core/enumerable/test_compact_collect.rb +0 -27
- data/test/lib/facets/core/enumerable/test_count.rb +0 -38
- data/test/lib/facets/core/enumerable/test_each_by.rb +0 -71
- data/test/lib/facets/core/enumerable/test_each_combination.rb +0 -29
- data/test/lib/facets/core/enumerable/test_each_pair.rb +0 -29
- data/test/lib/facets/core/enumerable/test_each_slice.rb +0 -57
- data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +0 -29
- data/test/lib/facets/core/enumerable/test_eachn.rb +0 -34
- data/test/lib/facets/core/enumerable/test_elementwise.rb +0 -40
- data/test/lib/facets/core/enumerable/test_entropy.rb +0 -26
- data/test/lib/facets/core/enumerable/test_every.rb +0 -35
- data/test/lib/facets/core/enumerable/test_ew.rb +0 -31
- data/test/lib/facets/core/enumerable/test_filter_collect.rb +0 -31
- data/test/lib/facets/core/enumerable/test_find_collisions.rb +0 -30
- data/test/lib/facets/core/enumerable/test_frequency.rb +0 -27
- data/test/lib/facets/core/enumerable/test_graph.rb +0 -30
- data/test/lib/facets/core/enumerable/test_ideal_entropy.rb +0 -27
- data/test/lib/facets/core/enumerable/test_none.rb +0 -33
- data/test/lib/facets/core/enumerable/test_occur.rb +0 -30
- data/test/lib/facets/core/enumerable/test_one.rb +0 -35
- data/test/lib/facets/core/enumerable/test_op_pow.rb +0 -27
- data/test/lib/facets/core/enumerable/test_op_tilde_self.rb +0 -40
- data/test/lib/facets/core/enumerable/test_partition_by.rb +0 -31
- data/test/lib/facets/core/enumerable/test_permutation.rb +0 -29
- data/test/lib/facets/core/enumerable/test_probability.rb +0 -27
- data/test/lib/facets/core/enumerable/test_to_h.rb +0 -27
- data/test/lib/facets/core/enumerable/test_uniq_by.rb +0 -28
- data/test/lib/facets/core/file/self/test_create.rb +0 -44
- data/test/lib/facets/core/file/self/test_open_as_string.rb +0 -50
- data/test/lib/facets/core/file/self/test_read_list.rb +0 -40
- data/test/lib/facets/core/file/self/test_sanitize.rb +0 -46
- data/test/lib/facets/core/file/self/test_split_all.rb +0 -27
- data/test/lib/facets/core/float/test_round_at.rb +0 -46
- data/test/lib/facets/core/float/test_round_to.rb +0 -46
- data/test/lib/facets/core/hash/self/test_zipnew.rb +0 -28
- data/test/lib/facets/core/hash/test_alias.rb +0 -31
- data/test/lib/facets/core/hash/test_assert_has_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_assert_has_only_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_at.rb +0 -28
- data/test/lib/facets/core/hash/test_collate.rb +0 -35
- data/test/lib/facets/core/hash/test_each_with_index.rb +0 -29
- data/test/lib/facets/core/hash/test_each_with_key.rb +0 -29
- data/test/lib/facets/core/hash/test_graph.rb +0 -28
- data/test/lib/facets/core/hash/test_has_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_has_only_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_inverse.rb +0 -30
- data/test/lib/facets/core/hash/test_normalize_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_op_fetch.rb +0 -111
- data/test/lib/facets/core/hash/test_op_lshift.rb +0 -29
- data/test/lib/facets/core/hash/test_rand_key.rb +0 -27
- data/test/lib/facets/core/hash/test_rand_pair.rb +0 -27
- data/test/lib/facets/core/hash/test_rand_value.rb +0 -27
- data/test/lib/facets/core/hash/test_rekey.rb +0 -52
- data/test/lib/facets/core/hash/test_replace_each.rb +0 -29
- data/test/lib/facets/core/hash/test_shuffle.rb +0 -32
- data/test/lib/facets/core/hash/test_slice.rb +0 -27
- data/test/lib/facets/core/hash/test_stringify_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_swap.rb +0 -27
- data/test/lib/facets/core/hash/test_swapkey.rb +0 -29
- data/test/lib/facets/core/hash/test_symbolize_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_to_h.rb +0 -27
- data/test/lib/facets/core/hash/test_to_ostruct.rb +0 -30
- data/test/lib/facets/core/hash/test_to_ostruct_recurse.rb +0 -44
- data/test/lib/facets/core/hash/test_traverse.rb +0 -37
- data/test/lib/facets/core/hash/test_update_each.rb +0 -29
- data/test/lib/facets/core/hash/test_update_keys.rb +0 -28
- data/test/lib/facets/core/hash/test_update_values.rb +0 -28
- data/test/lib/facets/core/hash/test_weave.rb +0 -29
- data/test/lib/facets/core/integer/test_factorial.rb +0 -30
- data/test/lib/facets/core/integer/test_multiple.rb +0 -43
- data/test/lib/facets/core/integer/test_of.rb +0 -28
- data/test/lib/facets/core/integer/test_ordinal.rb +0 -29
- data/test/lib/facets/core/integer/test_times_collect.rb +0 -28
- data/test/lib/facets/core/kernel/test___class__.rb +0 -26
- data/test/lib/facets/core/kernel/test_as.rb +0 -42
- data/test/lib/facets/core/kernel/test_assign_from.rb +0 -31
- data/test/lib/facets/core/kernel/test_assign_with.rb +0 -31
- data/test/lib/facets/core/kernel/test_bool.rb +0 -41
- data/test/lib/facets/core/kernel/test_bug.rb +0 -26
- data/test/lib/facets/core/kernel/test_call_stack.rb +0 -26
- data/test/lib/facets/core/kernel/test_called.rb +0 -26
- data/test/lib/facets/core/kernel/test_callee.rb +0 -26
- data/test/lib/facets/core/kernel/test_constant.rb +0 -33
- data/test/lib/facets/core/kernel/test_copy.rb +0 -40
- data/test/lib/facets/core/kernel/test_deep_copy.rb +0 -40
- data/test/lib/facets/core/kernel/test_demo.rb +0 -28
- data/test/lib/facets/core/kernel/test_fn.rb +0 -26
- data/test/lib/facets/core/kernel/test_get_by_id.rb +0 -28
- data/test/lib/facets/core/kernel/test_here.rb +0 -26
- data/test/lib/facets/core/kernel/test_in.rb +0 -27
- data/test/lib/facets/core/kernel/test_instance_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_instance_exec.rb +0 -58
- data/test/lib/facets/core/kernel/test_maybe.rb +0 -26
- data/test/lib/facets/core/kernel/test_meta_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_metaclass.rb +0 -27
- data/test/lib/facets/core/kernel/test_method.rb +0 -32
- data/test/lib/facets/core/kernel/test_methods.rb +0 -50
- data/test/lib/facets/core/kernel/test_new.rb +0 -30
- data/test/lib/facets/core/kernel/test_object_class.rb +0 -26
- data/test/lib/facets/core/kernel/test_object_hexid.rb +0 -27
- data/test/lib/facets/core/kernel/test_qua_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_require_all.rb +0 -26
- data/test/lib/facets/core/kernel/test_require_esc.rb +0 -27
- data/test/lib/facets/core/kernel/test_resc.rb +0 -27
- data/test/lib/facets/core/kernel/test_send_as.rb +0 -26
- data/test/lib/facets/core/kernel/test_set_from.rb +0 -33
- data/test/lib/facets/core/kernel/test_set_with.rb +0 -42
- data/test/lib/facets/core/kernel/test_silently.rb +0 -28
- data/test/lib/facets/core/kernel/test_singleton.rb +0 -40
- data/test/lib/facets/core/kernel/test_singleton_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_super_at.rb +0 -30
- data/test/lib/facets/core/kernel/test_supermethod.rb +0 -33
- data/test/lib/facets/core/kernel/test_this.rb +0 -26
- data/test/lib/facets/core/kernel/test_to_b.rb +0 -28
- data/test/lib/facets/core/kernel/test_to_bool.rb +0 -28
- data/test/lib/facets/core/kernel/test_to_data.rb +0 -61
- data/test/lib/facets/core/kernel/test_uri.rb +0 -30
- data/test/lib/facets/core/kernel/test_val.rb +0 -43
- data/test/lib/facets/core/kernel/test_with.rb +0 -30
- data/test/lib/facets/core/kernel/test_with_accessor.rb +0 -51
- data/test/lib/facets/core/matchdata/test_match.rb +0 -29
- data/test/lib/facets/core/matchdata/test_matchtree.rb +0 -37
- data/test/lib/facets/core/module/self/test_op_add.rb +0 -50
- data/test/lib/facets/core/module/test_abstract.rb +0 -36
- data/test/lib/facets/core/module/test_alias_method_chain.rb +0 -46
- data/test/lib/facets/core/module/test_alias_module_function.rb +0 -34
- data/test/lib/facets/core/module/test_ancestor.rb +0 -26
- data/test/lib/facets/core/module/test_attr_tester.rb +0 -39
- data/test/lib/facets/core/module/test_basename.rb +0 -26
- data/test/lib/facets/core/module/test_by_name.rb +0 -29
- data/test/lib/facets/core/module/test_class_extension.rb +0 -70
- data/test/lib/facets/core/module/test_clone_using.rb +0 -55
- data/test/lib/facets/core/module/test_dirname.rb +0 -26
- data/test/lib/facets/core/module/test_equate_on.rb +0 -37
- data/test/lib/facets/core/module/test_include_as.rb +0 -45
- data/test/lib/facets/core/module/test_initializer.rb +0 -32
- data/test/lib/facets/core/module/test_instance_methods.rb +0 -59
- data/test/lib/facets/core/module/test_integrate.rb +0 -35
- data/test/lib/facets/core/module/test_memoize.rb +0 -50
- data/test/lib/facets/core/module/test_modspace.rb +0 -27
- data/test/lib/facets/core/module/test_namespace.rb +0 -66
- data/test/lib/facets/core/module/test_nesting.rb +0 -36
- data/test/lib/facets/core/module/test_new.rb +0 -34
- data/test/lib/facets/core/module/test_nodef.rb +0 -30
- data/test/lib/facets/core/module/test_on_included.rb +0 -36
- data/test/lib/facets/core/module/test_redef.rb +0 -30
- data/test/lib/facets/core/module/test_redefine_method.rb +0 -30
- data/test/lib/facets/core/module/test_redirect.rb +0 -30
- data/test/lib/facets/core/module/test_redirect_method.rb +0 -30
- data/test/lib/facets/core/module/test_remove.rb +0 -30
- data/test/lib/facets/core/module/test_rename.rb +0 -31
- data/test/lib/facets/core/module/test_rename_method.rb +0 -31
- data/test/lib/facets/core/module/test_revisal.rb +0 -35
- data/test/lib/facets/core/module/test_shadow_method.rb +0 -30
- data/test/lib/facets/core/module/test_sort_on.rb +0 -42
- data/test/lib/facets/core/module/test_this.rb +0 -31
- data/test/lib/facets/core/module/test_wrap.rb +0 -30
- data/test/lib/facets/core/module/test_wrap_method.rb +0 -30
- data/test/lib/facets/core/nilclass/test_blank.rb +0 -26
- data/test/lib/facets/core/nilclass/test_empty.rb +0 -26
- data/test/lib/facets/core/nilclass/test_include.rb +0 -26
- data/test/lib/facets/core/nilclass/test_op_fetch.rb +0 -28
- data/test/lib/facets/core/nilclass/test_size.rb +0 -30
- data/test/lib/facets/core/nilclass/test_to_h.rb +0 -26
- data/test/lib/facets/core/numeric/test_approx.rb +0 -29
- data/test/lib/facets/core/numeric/test_ceil_multiple.rb +0 -31
- data/test/lib/facets/core/numeric/test_distance.rb +0 -28
- data/test/lib/facets/core/numeric/test_succ.rb +0 -40
- data/test/lib/facets/core/numeric/test_to_b.rb +0 -27
- data/test/lib/facets/core/ostruct/test___update__.rb +0 -45
- data/test/lib/facets/core/ostruct/test_instance_delegate.rb +0 -36
- data/test/lib/facets/core/ostruct/test_op_fetch.rb +0 -33
- data/test/lib/facets/core/proc/test_compose.rb +0 -29
- data/test/lib/facets/core/proc/test_op_mul.rb +0 -34
- data/test/lib/facets/core/proc/test_to_method.rb +0 -44
- data/test/lib/facets/core/range/test_to_r.rb +0 -27
- data/test/lib/facets/core/range/test_to_range.rb +0 -27
- data/test/lib/facets/core/range/test_umbrella.rb +0 -34
- data/test/lib/facets/core/range/test_within.rb +0 -29
- data/test/lib/facets/core/regexp/test_arity.rb +0 -33
- data/test/lib/facets/core/regexp/test_to_re.rb +0 -27
- data/test/lib/facets/core/regexp/test_to_regexp.rb +0 -27
- data/test/lib/facets/core/string/self/test_interpolate.rb +0 -27
- data/test/lib/facets/core/string/self/test_patterns.rb +0 -28
- data/test/lib/facets/core/string/self/test_rand_letter.rb +0 -26
- data/test/lib/facets/core/string/test_align_center.rb +0 -34
- data/test/lib/facets/core/string/test_at_rand.rb +0 -35
- data/test/lib/facets/core/string/test_basename.rb +0 -41
- data/test/lib/facets/core/string/test_blank.rb +0 -27
- data/test/lib/facets/core/string/test_bracket.rb +0 -49
- data/test/lib/facets/core/string/test_bytes.rb +0 -25
- data/test/lib/facets/core/string/test_camelcase.rb +0 -39
- data/test/lib/facets/core/string/test_camelize.rb +0 -26
- data/test/lib/facets/core/string/test_capitalize_all.rb +0 -26
- data/test/lib/facets/core/string/test_capitalized.rb +0 -26
- data/test/lib/facets/core/string/test_chars.rb +0 -27
- data/test/lib/facets/core/string/test_cleave.rb +0 -43
- data/test/lib/facets/core/string/test_cmp.rb +0 -30
- data/test/lib/facets/core/string/test_demodulize.rb +0 -38
- data/test/lib/facets/core/string/test_divide.rb +0 -29
- data/test/lib/facets/core/string/test_downcase.rb +0 -26
- data/test/lib/facets/core/string/test_dresner.rb +0 -32
- data/test/lib/facets/core/string/test_each_char.rb +0 -29
- data/test/lib/facets/core/string/test_each_word.rb +0 -29
- data/test/lib/facets/core/string/test_first.rb +0 -43
- data/test/lib/facets/core/string/test_fold.rb +0 -34
- data/test/lib/facets/core/string/test_humanize.rb +0 -26
- data/test/lib/facets/core/string/test_indent.rb +0 -40
- data/test/lib/facets/core/string/test_index_all.rb +0 -26
- data/test/lib/facets/core/string/test_last.rb +0 -46
- data/test/lib/facets/core/string/test_line_wrap.rb +0 -27
- data/test/lib/facets/core/string/test_lines.rb +0 -26
- data/test/lib/facets/core/string/test_lowercase.rb +0 -26
- data/test/lib/facets/core/string/test_margin.rb +0 -117
- data/test/lib/facets/core/string/test_methodize.rb +0 -27
- data/test/lib/facets/core/string/test_modulize.rb +0 -29
- data/test/lib/facets/core/string/test_mscan.rb +0 -30
- data/test/lib/facets/core/string/test_natcmp.rb +0 -30
- data/test/lib/facets/core/string/test_nchar.rb +0 -29
- data/test/lib/facets/core/string/test_pathize.rb +0 -29
- data/test/lib/facets/core/string/test_pop.rb +0 -47
- data/test/lib/facets/core/string/test_pot.rb +0 -39
- data/test/lib/facets/core/string/test_push.rb +0 -40
- data/test/lib/facets/core/string/test_quote.rb +0 -49
- data/test/lib/facets/core/string/test_rand_byte.rb +0 -35
- data/test/lib/facets/core/string/test_rand_index.rb +0 -26
- data/test/lib/facets/core/string/test_range.rb +0 -27
- data/test/lib/facets/core/string/test_range_all.rb +0 -27
- data/test/lib/facets/core/string/test_range_of_line.rb +0 -28
- data/test/lib/facets/core/string/test_regesc.rb +0 -28
- data/test/lib/facets/core/string/test_shatter.rb +0 -29
- data/test/lib/facets/core/string/test_shift.rb +0 -40
- data/test/lib/facets/core/string/test_shuffle.rb +0 -27
- data/test/lib/facets/core/string/test_similarity.rb +0 -26
- data/test/lib/facets/core/string/test_singular.rb +0 -86
- data/test/lib/facets/core/string/test_soundex.rb +0 -41
- data/test/lib/facets/core/string/test_succ.rb +0 -29
- data/test/lib/facets/core/string/test_to_a.rb +0 -27
- data/test/lib/facets/core/string/test_to_b.rb +0 -41
- data/test/lib/facets/core/string/test_to_const.rb +0 -28
- data/test/lib/facets/core/string/test_to_date.rb +0 -30
- data/test/lib/facets/core/string/test_to_proc.rb +0 -33
- data/test/lib/facets/core/string/test_to_re.rb +0 -28
- data/test/lib/facets/core/string/test_to_time.rb +0 -30
- data/test/lib/facets/core/string/test_unix_crypt.rb +0 -30
- data/test/lib/facets/core/string/test_unpack.rb +0 -34
- data/test/lib/facets/core/string/test_unshift.rb +0 -39
- data/test/lib/facets/core/string/test_upcase.rb +0 -30
- data/test/lib/facets/core/string/test_whitespace.rb +0 -27
- data/test/lib/facets/core/string/test_word_filter.rb +0 -34
- data/test/lib/facets/core/string/test_word_wrap.rb +0 -51
- data/test/lib/facets/core/string/test_words.rb +0 -37
- data/test/lib/facets/core/symbol/test_camelcase.rb +0 -26
- data/test/lib/facets/core/symbol/test_camelize.rb +0 -27
- data/test/lib/facets/core/symbol/test_capitalize.rb +0 -26
- data/test/lib/facets/core/symbol/test_capitalized.rb +0 -27
- data/test/lib/facets/core/symbol/test_downcase.rb +0 -27
- data/test/lib/facets/core/symbol/test_not.rb +0 -29
- data/test/lib/facets/core/symbol/test_pad.rb +0 -27
- data/test/lib/facets/core/symbol/test_succ.rb +0 -28
- data/test/lib/facets/core/symbol/test_to_const.rb +0 -28
- data/test/lib/facets/core/symbol/test_to_proc.rb +0 -33
- data/test/lib/facets/core/symbol/test_to_str.rb +0 -28
- data/test/lib/facets/core/symbol/test_underscore.rb +0 -26
- data/test/lib/facets/core/symbol/test_upcase.rb +0 -27
- data/test/lib/facets/core/time/test_change.rb +0 -33
- data/test/lib/facets/core/time/test_elapse.rb +0 -27
- data/test/lib/facets/core/time/test_stamp.rb +0 -39
- data/test/lib/facets/core/time/test_to_date.rb +0 -31
- data/test/lib/facets/core/time/test_to_s.rb +0 -31
- data/test/lib/facets/core/time/test_to_time.rb +0 -31
- data/test/lib/facets/more/test_ann.rb +0 -112
- data/test/lib/facets/more/test_ann_attr.rb +0 -39
- data/test/lib/facets/more/test_ansicode.rb +0 -36
- data/test/lib/facets/more/test_arguments.rb +0 -83
- data/test/lib/facets/more/test_association.rb +0 -51
- data/test/lib/facets/more/test_autoarray.rb +0 -32
- data/test/lib/facets/more/test_basicobject.rb +0 -67
- data/test/lib/facets/more/test_bbcode.rb +0 -34
- data/test/lib/facets/more/test_binaryreader.rb +0 -64
- data/test/lib/facets/more/test_bitmask.rb +0 -47
- data/test/lib/facets/more/test_buildingblock.rb +0 -48
- data/test/lib/facets/more/test_bytes.rb +0 -84
- data/test/lib/facets/more/test_classmethods.rb +0 -69
- data/test/lib/facets/more/test_command.rb +0 -69
- data/test/lib/facets/more/test_coroutine.rb +0 -60
- data/test/lib/facets/more/test_crypt.rb +0 -46
- data/test/lib/facets/more/test_cut.rb +0 -198
- data/test/lib/facets/more/test_dependency.rb +0 -82
- data/test/lib/facets/more/test_dictionary.rb +0 -107
- data/test/lib/facets/more/test_elementor.rb +0 -52
- data/test/lib/facets/more/test_enumerablepass.rb +0 -86
- data/test/lib/facets/more/test_floatstring.rb +0 -36
- data/test/lib/facets/more/test_functor.rb +0 -39
- data/test/lib/facets/more/test_htmlbuilder.rb +0 -38
- data/test/lib/facets/more/test_htmlfilter.rb +0 -86
- data/test/lib/facets/more/test_infinity.rb +0 -50
- data/test/lib/facets/more/test_inheritor.rb +0 -155
- data/test/lib/facets/more/test_instance_intercept.rb +0 -50
- data/test/lib/facets/more/test_interval.rb +0 -119
- data/test/lib/facets/more/test_json.rb +0 -232
- data/test/lib/facets/more/test_linkedlist.rb +0 -53
- data/test/lib/facets/more/test_lisp.rb +0 -47
- data/test/lib/facets/more/test_lisp_format.rb +0 -37
- data/test/lib/facets/more/test_lrucache.rb +0 -25
- data/test/lib/facets/more/test_mathconstants.rb +0 -18
- data/test/lib/facets/more/test_methodfilter.rb +0 -45
- data/test/lib/facets/more/test_methodprobe.rb +0 -53
- data/test/lib/facets/more/test_multipliers.rb +0 -114
- data/test/lib/facets/more/test_multiton.rb +0 -199
- data/test/lib/facets/more/test_nackclass.rb +0 -45
- data/test/lib/facets/more/test_nilcomparable.rb +0 -47
- data/test/lib/facets/more/test_opencascade.rb +0 -75
- data/test/lib/facets/more/test_openobject.rb +0 -126
- data/test/lib/facets/more/test_overload.rb +0 -54
- data/test/lib/facets/more/test_paramix.rb +0 -100
- data/test/lib/facets/more/test_pqueue.rb +0 -39
- data/test/lib/facets/more/test_preinitialize.rb +0 -49
- data/test/lib/facets/more/test_promoteself.rb +0 -45
- data/test/lib/facets/more/test_recorder.rb +0 -44
- data/test/lib/facets/more/test_snapshot.rb +0 -34
- data/test/lib/facets/more/test_statichash.rb +0 -31
- data/test/lib/facets/more/test_syncarray.rb +0 -28
- data/test/lib/facets/more/test_synchash.rb +0 -28
- data/test/lib/facets/more/test_tagiterator.rb +0 -93
- data/test/lib/facets/more/test_timer.rb +0 -66
- data/test/lib/facets/more/test_times.rb +0 -103
- data/test/lib/facets/more/test_tuple.rb +0 -64
- data/test/lib/facets/more/test_typecast.rb +0 -68
- data/test/lib/facets/more/test_uninheritable.rb +0 -42
- data/test/lib/facets/more/test_units.rb +0 -111
- data/test/lib/facets/more/test_xmlbuilder.rb +0 -54
- data/test/lib/facets/more/test_xmlhelper.rb +0 -40
- data/test/lib/facets/more/test_xoxo.rb +0 -288
- data/test/lib/facets/more/test_yamlstruct.rb +0 -37
- data/test/lib/facets/yore/enumerable/test_cross.rb +0 -44
- data/test/lib/facets/yore/kernel/test_require_facet.rb +0 -27
- data/test/lib/facets/yore/module/test_namespace.rb +0 -33
- data/test/lib/facets/yore/test_annattr.rb +0 -39
- data/test/lib/facets/yore/test_annotation.rb +0 -318
- data/work/README +0 -42
- data/work/TODO +0 -73
- data/work/bin/minitar +0 -3
- data/work/bin/minitar.rb +0 -814
- data/work/core/array/at_rand.rb +0 -95
- data/work/core/array/each_slice.rb +0 -23
- data/work/core/array/pick_values.rb +0 -32
- data/work/core/array/rand_indexes.rb +0 -33
- data/work/core/binding/class.rb +0 -11
- data/work/core/binding/delegate-binding.rb +0 -19
- data/work/core/binding/delegate.rb +0 -15
- data/work/core/binding/proc.rb +0 -6
- data/work/core/class/to_module.rb +0 -3
- data/work/core/enumerable/op_fetch.rb +0 -30
- data/work/core/fileutils/cptouch.rb +0 -20
- data/work/core/fileutils/nl_convert.rb +0 -133
- data/work/core/io/expect.rb +0 -127
- data/work/core/join_with.rb +0 -13
- data/work/core/kernel/call_line.rb +0 -15
- data/work/core/kernel/does.rb +0 -7
- data/work/core/kernel/message.rb +0 -6
- data/work/core/kernel/query.rb +0 -15
- data/work/core/kernel/taint.rb +0 -10
- data/work/core/logger/clean_logger.rb +0 -10
- data/work/core/module/attr-old.rb +0 -308
- data/work/core/module/attr.rb +0 -98
- data/work/core/module/attr_xxx.rb +0 -22
- data/work/core/module/by_regexp.rb +0 -21
- data/work/core/module/cast.rb +0 -64
- data/work/core/module/class_attribute_accessors.rb +0 -57
- data/work/core/module/inherit.rb +0 -99
- data/work/core/module/inherit0.rb +0 -59
- data/work/core/module/let.rb +0 -51
- data/work/core/module/meta_attr.rb +0 -60
- data/work/core/module/module_attribute_accessors.rb +0 -57
- data/work/core/module/permissions.rb +0 -32
- data/work/core/module/preserved.rb +0 -108
- data/work/core/module/sattr_accessor.rb +0 -1
- data/work/core/module/sattr_reader.rb +0 -1
- data/work/core/module/sattr_setter.rb +0 -1
- data/work/core/module/sattr_tester.rb +0 -1
- data/work/core/module/sattr_writer.rb +0 -1
- data/work/core/module/tc_attr.rb +0 -107
- data/work/core/module/to_module.rb +0 -37
- data/work/core/module/version.rb +0 -23
- data/work/core/string/frequency.rb +0 -40
- data/work/core/string/op_add.rb +0 -24
- data/work/core/string/op_div.rb +0 -15
- data/work/core/string/pred.rb +0 -217
- data/work/core/string/probability.rb +0 -35
- data/work/core/string/succ_distance.rb +0 -112
- data/work/core/string/to_arr.rb +0 -57
- data/work/core/string/to_ary.rb +0 -12
- data/work/core/string/word_wrap.rb +0 -62
- data/work/hash_open.rb +0 -23
- data/work/misc/calibre/ProjectInfo.annotation +0 -46
- data/work/misc/calibre/ProjectInfo.ansicode +0 -33
- data/work/misc/calibre/ProjectInfo.association +0 -34
- data/work/misc/calibre/ProjectInfo.basicobject +0 -36
- data/work/misc/calibre/ProjectInfo.bbcode +0 -34
- data/work/misc/calibre/ProjectInfo.binaryreader +0 -35
- data/work/misc/calibre/ProjectInfo.bitmask +0 -33
- data/work/misc/calibre/ProjectInfo.classinherit +0 -36
- data/work/misc/calibre/ProjectInfo.classmethods +0 -36
- data/work/misc/calibre/ProjectInfo.cloneable +0 -33
- data/work/misc/calibre/ProjectInfo.consoleapp +0 -35
- data/work/misc/calibre/ProjectInfo.coroutine +0 -37
- data/work/misc/calibre/ProjectInfo.crypt +0 -33
- data/work/misc/calibre/ProjectInfo.dictionary +0 -40
- data/work/misc/calibre/ProjectInfo.downloader +0 -39
- data/work/misc/calibre/ProjectInfo.enumerablepass +0 -35
- data/work/misc/calibre/ProjectInfo.expirable +0 -37
- data/work/misc/calibre/ProjectInfo.floatstring +0 -35
- data/work/misc/calibre/ProjectInfo.functor +0 -40
- data/work/misc/calibre/ProjectInfo.heap +0 -33
- data/work/misc/calibre/ProjectInfo.inheritor +0 -36
- data/work/misc/calibre/ProjectInfo.interval +0 -36
- data/work/misc/calibre/ProjectInfo.lisp +0 -38
- data/work/misc/calibre/ProjectInfo.lrucache +0 -34
- data/work/misc/calibre/ProjectInfo.mathconstants +0 -41
- data/work/misc/calibre/ProjectInfo.methodprobe +0 -38
- data/work/misc/calibre/ProjectInfo.mock +0 -34
- data/work/misc/calibre/ProjectInfo.multiton +0 -36
- data/work/misc/calibre/ProjectInfo.nackclass +0 -33
- data/work/misc/calibre/ProjectInfo.nilcomparable +0 -35
- data/work/misc/calibre/ProjectInfo.nullclass +0 -35
- data/work/misc/calibre/ProjectInfo.one +0 -37
- data/work/misc/calibre/ProjectInfo.openobject +0 -39
- data/work/misc/calibre/ProjectInfo.paramix +0 -38
- data/work/misc/calibre/ProjectInfo.pool +0 -33
- data/work/misc/calibre/ProjectInfo.progressbar +0 -37
- data/work/misc/calibre/ProjectInfo.reference +0 -36
- data/work/misc/calibre/ProjectInfo.semaphore +0 -36
- data/work/misc/calibre/ProjectInfo.stateparser +0 -39
- data/work/misc/calibre/ProjectInfo.statichash +0 -33
- data/work/misc/calibre/ProjectInfo.system +0 -34
- data/work/misc/calibre/ProjectInfo.tagiterator +0 -36
- data/work/misc/calibre/ProjectInfo.timer +0 -35
- data/work/misc/calibre/ProjectInfo.tracepoint +0 -37
- data/work/misc/calibre/ProjectInfo.tuple +0 -36
- data/work/misc/calibre/ProjectInfo.uniheritable +0 -34
- data/work/misc/calibre/ProjectInfo.units +0 -34
- data/work/misc/calibre/ProjectInfo.yamlstruct +0 -34
- data/work/more/annotation-rw.rb +0 -217
- data/work/more/aobject.rb +0 -132
- data/work/more/autohash.rb +0 -67
- data/work/more/cache.rb +0 -189
- data/work/more/class_inheritable_attributes.rb +0 -120
- data/work/more/commandrunner.rb +0 -101
- data/work/more/daemon.rb +0 -70
- data/work/more/debugger.rb +0 -167
- data/work/more/detach.rb +0 -423
- data/work/more/enumtype.rb +0 -115
- data/work/more/ioreactor.rb +0 -671
- data/work/more/logger_sing.rb +0 -207
- data/work/more/must.rb +0 -37
- data/work/more/old-tkxml.rb +0 -189
- data/work/more/pairhash.rb +0 -55
- data/work/more/password.rb +0 -80
- data/work/more/print_exception.rb +0 -35
- data/work/more/rand.rb +0 -412
- data/work/more/range.rb +0 -383
- data/work/more/sanitize.rb +0 -48
- data/work/more/superstruct.rb +0 -735
- data/work/more/tag.rb +0 -31
- data/work/more/timer.rb +0 -164
- data/work/op_rshift.rb +0 -87
- data/work/openobject-temp.rb +0 -45
- data/work/pore/autorequire.rb +0 -83
- data/work/pore/basefactory.rb +0 -40
- data/work/pore/hash/each.rb +0 -76
- data/work/pore/merge3.rb +0 -765
- data/work/pore/superann.rb +0 -134
- data/work/pore/sys.rb +0 -186
- data/work/pore/utils.rb +0 -518
- data/work/yore/HashAquisition.rb +0 -36
- data/work/yore/Rakefile.old +0 -181
- data/work/yore/Reapfile +0 -63
- data/work/yore/annotation.rb +0 -489
- data/work/yore/annotation2.rb +0 -466
- data/work/yore/commandutils.rb +0 -379
- data/work/yore/openobject.rb +0 -298
- data/work/yore/reap.rb +0 -184
- data/work/yore/reap.yml +0 -47
- data/work/yore/taskable-old.rb +0 -519
- data/work/yore/taskable.rb +0 -482
@@ -1,64 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/tuple.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/tuple.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TC_Tuple < Test::Unit::TestCase
|
19
|
-
|
20
|
-
def test_01
|
21
|
-
t1 = Tuple[1,2,3]
|
22
|
-
t2 = Tuple[2,4,5]
|
23
|
-
assert( t1 < t2 )
|
24
|
-
assert( t2 > t1 )
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_02
|
28
|
-
t1 = Tuple[1,2,3]
|
29
|
-
a1 = t1.to_a
|
30
|
-
assert( Array === a1 )
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_03
|
34
|
-
t1 = Tuple[1,2,3]
|
35
|
-
t2 = Tuple[1,2,3]
|
36
|
-
assert( t1.object_id === t2.object_id )
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_04
|
40
|
-
t1 = Tuple[1,2,3]
|
41
|
-
t1 = t1 << 4
|
42
|
-
assert( Tuple === t1 )
|
43
|
-
t2 = Tuple[1,2,3,4]
|
44
|
-
assert( t1.object_id == t2.object_id )
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_05
|
48
|
-
t1 = "1.2.3".to_t
|
49
|
-
assert( Tuple === t1 )
|
50
|
-
t2 = Tuple[1,2,3]
|
51
|
-
assert( t1.object_id == t2.object_id )
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_06
|
55
|
-
t1 = "1.2.3a".to_t
|
56
|
-
assert( Tuple === t1 )
|
57
|
-
t2 = Tuple[1,2,'3a']
|
58
|
-
assert_equal( t2, t1 )
|
59
|
-
assert( t2.object_id == t1.object_id )
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/typecast.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/typecast.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TestClass
|
19
|
-
attr_accessor :my_var
|
20
|
-
def initialize(my_var); @my_var = my_var; end
|
21
|
-
|
22
|
-
def to_string(options={})
|
23
|
-
@my_var
|
24
|
-
end
|
25
|
-
|
26
|
-
class << self
|
27
|
-
def from_string(string, options={})
|
28
|
-
self.new( string )
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class TC_TypeCast < Test::Unit::TestCase
|
34
|
-
|
35
|
-
def setup
|
36
|
-
@test_string = "this is a test"
|
37
|
-
@test_class = TestClass.new(@test_string)
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_to_string
|
41
|
-
assert_equal( '1234', 1234.cast_to(String) )
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_custom_to_string
|
45
|
-
assert_equal( @test_string, @test_class.cast_to(String) )
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_custom_from_string
|
49
|
-
assert_equal( @test_class.my_var, @test_string.cast_to(TestClass).my_var )
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_string_to_class
|
53
|
-
assert_equal( Test::Unit::TestCase, "Test::Unit::TestCase".cast_to(Class) )
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_string_to_time
|
57
|
-
assert_equal( "Mon Oct 10 00:00:00 2005", "2005-10-10".cast_to(Time).strftime("%a %b %d %H:%M:%S %Y") )
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_no_converter
|
61
|
-
"sfddsf".cast_to( ::Regexp )
|
62
|
-
assert(1+1==3, 'should not get here')
|
63
|
-
rescue TypeCastException => ex
|
64
|
-
assert_equal(TypeCastException, ex.class)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/uninheritable.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/uninheritable.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TC_Uninheritable < Test::Unit::TestCase
|
19
|
-
|
20
|
-
class Cannot
|
21
|
-
extend Uninheritable
|
22
|
-
end
|
23
|
-
|
24
|
-
class Can
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_module
|
28
|
-
assert_nothing_raised {
|
29
|
-
self.instance_eval <<-EOS
|
30
|
-
class A < Can; end
|
31
|
-
EOS
|
32
|
-
}
|
33
|
-
assert_raises(TypeError, "Class Cannot cannot be subclassed.") do
|
34
|
-
self.instance_eval <<-EOS
|
35
|
-
class B < Cannot; end
|
36
|
-
EOS
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
|
@@ -1,111 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/units.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/units.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
include Units
|
19
|
-
|
20
|
-
class TC01 < Test::Unit::TestCase
|
21
|
-
|
22
|
-
def test_01_001
|
23
|
-
assert_equal( "65.0 bit/s", (1.bit/s + 8.bytes/s).to_s )
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_01_002
|
27
|
-
assert_equal( "0.125 byte/s", ((1.bit/s).to(byte/s)).to_s )
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_01_003
|
31
|
-
assert_equal( "5280.0 feet", (1.mile.to(feet)).to_s )
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_01_004
|
35
|
-
assert_equal( "4840.0 yd**2", (1.acre.to(yd**2)).to_s )
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_01_005
|
39
|
-
assert_equal( "4840.0 sq_yd", (1.acre.to(sq_yd)).to_s )
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_01_006
|
43
|
-
assert_equal( "3.785411784 L", (1.gallon.to(self.L)).to_s )
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_01_007
|
47
|
-
assert_equal( "0.45359237 kg", (1.lb.to(kg)).to_s )
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_01_008
|
51
|
-
r = (1.m.s.to(m.s)).to_s
|
52
|
-
assert( "1 s m" == r || "1 m s" == r )
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_01_009
|
56
|
-
assert_equal( "2.589988110336 km**2", (1.sq_mi.to(km**2)).to_s )
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_01_010
|
60
|
-
assert_equal( "1.609344 km", (1.mile.to(km)).to_s )
|
61
|
-
end
|
62
|
-
|
63
|
-
# currency rates change frequently, temp commented
|
64
|
-
#def test_01_011
|
65
|
-
# assert_equal( "33.2750003803837 twd", (1.usd.to(twd)).to_s )
|
66
|
-
#end
|
67
|
-
|
68
|
-
def test_01_012
|
69
|
-
with_unit_converter(:uk) {
|
70
|
-
assert_equal( "112.0 lb", 1.cwt.to(lb).to_s )
|
71
|
-
}
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_01_013
|
75
|
-
with_unit_converter(:us) {
|
76
|
-
assert_equal( "100.0 lb", 1.cwt.to(lb).to_s )
|
77
|
-
}
|
78
|
-
end
|
79
|
-
|
80
|
-
def test_01_014
|
81
|
-
assert_equal( "112.0 lb", (1.cwt(:uk).to(lb(:uk))).to_s )
|
82
|
-
assert_equal( "100.0 lb", (1.cwt(:us).to(lb(:us))).to_s )
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_01_015
|
86
|
-
assert_equal( "lb", (Converter.current.lb).to_s )
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_01_016
|
90
|
-
assert(
|
91
|
-
[:us, :cex, :default, :uk].all? { |c|
|
92
|
-
Converter.registered_converters.include?( c )
|
93
|
-
}
|
94
|
-
)
|
95
|
-
end
|
96
|
-
|
97
|
-
# Money exchange is off line at the moment
|
98
|
-
|
99
|
-
#def test_01_017
|
100
|
-
# assert_raises(TypeError) {
|
101
|
-
# 1.try.to(usd)
|
102
|
-
# }
|
103
|
-
#end
|
104
|
-
|
105
|
-
#def test_01_016
|
106
|
-
# assert_equal( "33.2190007563597 twd", (1.usd(:cex).to(twd(:cex))).to_s )
|
107
|
-
#end
|
108
|
-
|
109
|
-
end
|
110
|
-
|
111
|
-
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/xmlbuilder.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/xmlbuilder.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TCXMLBuilder < Test::Unit::TestCase
|
19
|
-
|
20
|
-
def test_01
|
21
|
-
x = XMLBuilder.new
|
22
|
-
doc = x.html {
|
23
|
-
head {
|
24
|
-
title "Test"
|
25
|
-
}
|
26
|
-
body {
|
27
|
-
p "Hello"
|
28
|
-
text "Test"
|
29
|
-
}
|
30
|
-
}
|
31
|
-
r = "<html><head><title>Test</title></head><body><p>Hello</p>Test</body></html>"
|
32
|
-
assert_equal( r, doc )
|
33
|
-
assert_equal( r, x.to_s )
|
34
|
-
end
|
35
|
-
|
36
|
-
#def tes_explicit
|
37
|
-
# x = XMLBuilder.new(true)
|
38
|
-
# doc = x.html {
|
39
|
-
# x.head {
|
40
|
-
# x.title "Test"
|
41
|
-
# }
|
42
|
-
# x.body {
|
43
|
-
# x.p "Hello"
|
44
|
-
# x << text("Test")
|
45
|
-
# }
|
46
|
-
# }
|
47
|
-
# r = "<html><head><title>Test</title></head><body><p>Hello</p>Test</body></html>"
|
48
|
-
# assert_equal( r, doc )
|
49
|
-
# assert_equal( r, x.to_s )
|
50
|
-
#end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/xmlhelper.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/xmlhelper.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TCXMLHelper < Test::Unit::TestCase
|
19
|
-
|
20
|
-
def test_01
|
21
|
-
x = XMLHelper
|
22
|
-
d = x.element( :a )
|
23
|
-
assert_equal( "<a />", d )
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_02
|
27
|
-
x = XMLHelper
|
28
|
-
d = x.element( :a, x.element( :b, "X" ) )
|
29
|
-
assert_equal( "<a><b>X</b></a>", d )
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_03
|
33
|
-
x = XMLHelper
|
34
|
-
d = x.element( :a, x.element( :b, "X" ) + x.element( :c, "Y" ) )
|
35
|
-
assert_equal( "<a><b>X</b><c>Y</c></a>", d )
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
|
@@ -1,288 +0,0 @@
|
|
1
|
-
# _____ _
|
2
|
-
# |_ _|__ ___| |_
|
3
|
-
# | |/ _ \/ __| __|
|
4
|
-
# | | __/\__ \ |_
|
5
|
-
# |_|\___||___/\__|
|
6
|
-
#
|
7
|
-
# for lib/facets/more/xoxo.rb
|
8
|
-
#
|
9
|
-
# Extracted Fri Feb 16 02:00:36 EST 2007
|
10
|
-
# Project.rb Test Extraction
|
11
|
-
#
|
12
|
-
|
13
|
-
require 'facets/more/xoxo.rb'
|
14
|
-
|
15
|
-
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
class TCXOXO < Test::Unit::TestCase
|
19
|
-
|
20
|
-
def test_simple_list
|
21
|
-
l = ['1', '2', '3']
|
22
|
-
html = XOXO.dump(l)
|
23
|
-
assert_equal '<ol class="xoxo"><li>1</li><li>2</li><li>3</li></ol>', html
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_nested_list
|
27
|
-
l = ['1', ['2', '3']]
|
28
|
-
assert_equal '<ol class="xoxo"><li>1</li><li><ol><li>2</li><li>3</li></ol></li></ol>', XOXO.dump(l)
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_hash
|
32
|
-
h = {'test' => '1', 'name' => 'Kevin'}
|
33
|
-
# Changed since Ruby sorts the hash differently.
|
34
|
-
assert_equal '<ol class="xoxo"><li><dl><dt>name</dt><dd>Kevin</dd><dt>test</dt><dd>1</dd></dl></li></ol>', XOXO.dump(h)
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_single_item
|
38
|
-
l = 'test'
|
39
|
-
assert_equal '<ol class="xoxo"><li>test</li></ol>', XOXO.dump(l)
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_wrap_differs
|
43
|
-
l = 'test'
|
44
|
-
html = XOXO.dump(l)
|
45
|
-
html_wrap = XOXO.dump(l, :html_wrap => true)
|
46
|
-
assert_not_equal html, html_wrap
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_wrap_single_item
|
50
|
-
l = 'test'
|
51
|
-
html = XOXO.dump(l, :html_wrap => true)
|
52
|
-
assert_equal <<EOF.strip, html
|
53
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
|
54
|
-
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
55
|
-
<html xmlns="http://www.w3.org/1999/xhtml"><head profile=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><ol class="xoxo"><li>test</li></ol></body></html>
|
56
|
-
EOF
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_wrap_item_with_css
|
60
|
-
l = 'test'
|
61
|
-
html = XOXO.dump(l, :html_wrap => true, :css => 'reaptest.css')
|
62
|
-
assert_equal <<EOF.strip, html
|
63
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
|
64
|
-
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
65
|
-
<html xmlns="http://www.w3.org/1999/xhtml"><head profile=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css" >@import "reaptest.css";</style></head><body><ol class="xoxo"><li>test</li></ol></body></html>
|
66
|
-
EOF
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_hash_roundtrip
|
70
|
-
h = {'test' => '1', 'name' => 'Kevin'}
|
71
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_hash_with_url_roundtrip
|
75
|
-
h = {'url' => 'http://example.com', 'name' => 'Kevin'}
|
76
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_nested_hash_roundtrip
|
80
|
-
h = {'test' => '1', 'inner' => {'name' => 'Kevin'}}
|
81
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_nested_hash_with_url_roundtrip
|
85
|
-
h = {'url' => 'http://example.com', 'inner' => {
|
86
|
-
'url' => 'http://slashdot.org', 'name' => 'Kevin'}}
|
87
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
88
|
-
end
|
89
|
-
|
90
|
-
def test_list_round_trip
|
91
|
-
l = ['3', '2', '1']
|
92
|
-
assert_equal l, XOXO.load(XOXO.dump(l))
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_list_of_hashes_round_trip
|
96
|
-
l = ['3', {'a' => '2'}, {'b' => '1', 'c' => '4'}]
|
97
|
-
assert_equal l, XOXO.load(XOXO.dump(l))
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_list_of_lists_round_trip
|
101
|
-
l = ['3', ['a', '2'], ['b', ['1', ['c', '4']]]]
|
102
|
-
assert_equal l, XOXO.load(XOXO.dump(l))
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_hashes_of_lists_roundtrip
|
106
|
-
h = {
|
107
|
-
'test' => ['1', '2'],
|
108
|
-
'name' => 'Kevin',
|
109
|
-
'nestlist' => ['a', ['b', 'c']],
|
110
|
-
'nestdict' => {'e' => '6', 'f' => '7'}
|
111
|
-
}
|
112
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
113
|
-
end
|
114
|
-
|
115
|
-
def test_xoxo_junk_in_containers
|
116
|
-
h = XOXO.load '<ol>bad<li><dl>worse<dt>good</dt><dd>buy</dd> now</dl></li></ol>'
|
117
|
-
assert_equal({'good' => 'buy'}, h)
|
118
|
-
end
|
119
|
-
|
120
|
-
def test_xoxo_junk_in_elements
|
121
|
-
l = XOXO.load '<ol><li>bad<dl><dt>good</dt><dd>buy</dd></dl>worse</li><li>bag<ol><li>OK</li></ol>fish</li></ol>'
|
122
|
-
assert_equal([{'good' => 'buy'}, ['OK']], l)
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_xoxo_with_spaces_and_newlines
|
126
|
-
xoxo_sample = <<EOF.strip
|
127
|
-
<ol class='xoxo'>
|
128
|
-
<li>
|
129
|
-
<dl>
|
130
|
-
<dt>text</dt>
|
131
|
-
<dd>item 1</dd>
|
132
|
-
<dt>description</dt>
|
133
|
-
<dd> This item represents the main point we're trying to make.</dd>
|
134
|
-
<dt>url</dt>
|
135
|
-
<dd>http://example.com/more.xoxo</dd>
|
136
|
-
<dt>title</dt>
|
137
|
-
<dd>title of item 1</dd>
|
138
|
-
<dt>type</dt>
|
139
|
-
<dd>text/xml</dd>
|
140
|
-
<dt>rel</dt>
|
141
|
-
<dd>help</dd>
|
142
|
-
</dl>
|
143
|
-
</li>
|
144
|
-
</ol>
|
145
|
-
EOF
|
146
|
-
h = XOXO.load xoxo_sample
|
147
|
-
h2 = {
|
148
|
-
'text' => 'item 1',
|
149
|
-
'description' => " This item represents the main point we're trying to make.",
|
150
|
-
'url' => 'http://example.com/more.xoxo',
|
151
|
-
'title' => 'title of item 1',
|
152
|
-
'type' => 'text/xml',
|
153
|
-
'rel' => 'help'
|
154
|
-
}
|
155
|
-
assert_equal h2, XOXO.load(xoxo_sample)
|
156
|
-
end
|
157
|
-
|
158
|
-
def test_special_attribute_decoding
|
159
|
-
xoxo_sample = <<EOF.strip
|
160
|
-
<ol class='xoxo'>
|
161
|
-
<li>
|
162
|
-
<dl>
|
163
|
-
<dt>text</dt>
|
164
|
-
<dd>item 1</dd>
|
165
|
-
<dt>url</dt>
|
166
|
-
<dd>http://example.com/more.xoxo</dd>
|
167
|
-
<dt>title</dt>
|
168
|
-
<dd>title of item 1</dd>
|
169
|
-
<dt>type</dt>
|
170
|
-
<dd>text/xml</dd>
|
171
|
-
<dt>rel</dt>
|
172
|
-
<dd>help</dd>
|
173
|
-
</dl>
|
174
|
-
</li>
|
175
|
-
</ol>
|
176
|
-
EOF
|
177
|
-
smart_xoxo_sample = <<EOF.strip
|
178
|
-
<ol class='xoxo'>
|
179
|
-
<li><a href="http://example.com/more.xoxo"
|
180
|
-
title="title of item 1"
|
181
|
-
type="text/xml"
|
182
|
-
rel="help">item 1</a>
|
183
|
-
<!-- note how the "text" property is simply the contents of the <a> element -->
|
184
|
-
</li>
|
185
|
-
</ol>
|
186
|
-
EOF
|
187
|
-
assert_equal XOXO.load(xoxo_sample), XOXO.load(smart_xoxo_sample)
|
188
|
-
end
|
189
|
-
|
190
|
-
def test_special_attribute_and_dl_decoding
|
191
|
-
xoxo_sample = <<EOF.strip
|
192
|
-
<ol class="xoxo">
|
193
|
-
<li>
|
194
|
-
<dl>
|
195
|
-
<dt>text</dt>
|
196
|
-
<dd>item 1</dd>
|
197
|
-
<dt>description</dt>
|
198
|
-
<dd> This item represents the main point we're trying to make.</dd>
|
199
|
-
<dt>url</dt>
|
200
|
-
<dd>http://example.com/more.xoxo</dd>
|
201
|
-
<dt>title</dt>
|
202
|
-
<dd>title of item 1</dd>
|
203
|
-
<dt>type</dt>
|
204
|
-
<dd>text/xml</dd>
|
205
|
-
<dt>rel</dt>
|
206
|
-
<dd>help</dd>
|
207
|
-
</dl>
|
208
|
-
</li>
|
209
|
-
</ol>
|
210
|
-
EOF
|
211
|
-
smart_xoxo_sample = <<EOF.strip
|
212
|
-
<ol class="xoxo">
|
213
|
-
<li><a href="http://example.com/more.xoxo"
|
214
|
-
title="title of item 1"
|
215
|
-
type="text/xml"
|
216
|
-
rel="help">item 1</a>
|
217
|
-
<!-- note how the "text" property is simply the contents of the <a> element -->
|
218
|
-
<dl>
|
219
|
-
<dt>description</dt>
|
220
|
-
<dd> This item represents the main point we're trying to make.</dd>
|
221
|
-
</dl>
|
222
|
-
</li>
|
223
|
-
</ol>
|
224
|
-
EOF
|
225
|
-
assert_equal XOXO.load(xoxo_sample), XOXO.load(smart_xoxo_sample)
|
226
|
-
end
|
227
|
-
|
228
|
-
def test_special_attribute_encode
|
229
|
-
h = {
|
230
|
-
'url' => 'http://example.com/more.xoxo',
|
231
|
-
'title' => 'sample url',
|
232
|
-
'type' => "text/xml",
|
233
|
-
'rel' => 'help',
|
234
|
-
'text' => 'an example'
|
235
|
-
}
|
236
|
-
assert_equal '<ol class="xoxo"><li><a href="http://example.com/more.xoxo" title="sample url" rel="help" type="text/xml" >an example</a></li></ol>', XOXO.dump(h)
|
237
|
-
end
|
238
|
-
|
239
|
-
def test_special_attribute_roundtrip_full
|
240
|
-
h = {
|
241
|
-
'url' => 'http://example.com/more.xoxo',
|
242
|
-
'title' => 'sample url',
|
243
|
-
'type' => "text/xml",
|
244
|
-
'rel' => 'help',
|
245
|
-
'text' => 'an example'
|
246
|
-
}
|
247
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
248
|
-
end
|
249
|
-
|
250
|
-
def test_special_attribute_roundtrip_no_text
|
251
|
-
h = {
|
252
|
-
'url' => 'http://example.com/more.xoxo',
|
253
|
-
'title' => 'sample url',
|
254
|
-
'type' => "text/xml",
|
255
|
-
'rel' => 'help'
|
256
|
-
}
|
257
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
258
|
-
end
|
259
|
-
|
260
|
-
def test_special_attribute_roundtrip_no_text_or_title
|
261
|
-
h = {'url' => 'http://example.com/more.xoxo'}
|
262
|
-
assert_equal h, XOXO.load(XOXO.dump(h))
|
263
|
-
end
|
264
|
-
|
265
|
-
def test_attention_roundtrip
|
266
|
-
kmattn = <<EOF.strip
|
267
|
-
<ol class="xoxo"><li><a href="http://www.boingboing.net/" title="Boing Boing Blog" >Boing Boing Blog</a><dl><dt>alturls</dt><dd><ol><li><a href="http://boingboing.net/rss.xml" >xmlurl</a></li></ol></dd><dt>description</dt><dd>Boing Boing Blog</dd></dl></li><li><a href="http://www.financialcryptography.com/" title="Financial Cryptography" >Financial Cryptography</a><dl><dt>alturls</dt><dd><ol><li><a href="http://www.financialcryptography.com/mt/index.rdf" >xmlurl</a></li></ol></dd><dt>description</dt><dd>Financial Cryptography</dd></dl></li><li><a href="http://hublog.hubmed.org/" title="HubLog" >HubLog</a><dl><dt>alturls</dt><dd><ol><li><a href="http://hublog.hubmed.org/index.xml" >xmlurl</a></li><li><a href="http://hublog.hubmed.org/foaf.rdf" >foafurl</a></li></ol></dd><dt>description</dt><dd>HubLog</dd></dl></li></ol>
|
268
|
-
EOF
|
269
|
-
assert_equal kmattn, XOXO.dump(XOXO.load(kmattn))
|
270
|
-
assert_equal XOXO.load(kmattn), XOXO.load(XOXO.dump(XOXO.load(kmattn)))
|
271
|
-
assert_equal XOXO.dump(XOXO.load(kmattn)),
|
272
|
-
XOXO.dump(XOXO.load(XOXO.dump(XOXO.load(kmattn))))
|
273
|
-
end
|
274
|
-
|
275
|
-
def test_unicode_roundtrip
|
276
|
-
unicode = "Tantek \xc3\x87elik and a snowman \xe2\x98\x83"
|
277
|
-
assert_equal unicode, XOXO.load(XOXO.dump(unicode))
|
278
|
-
end
|
279
|
-
|
280
|
-
# TBD: Implement proper encodings.
|
281
|
-
#
|
282
|
-
# def test_utf8_roundtrip
|
283
|
-
# end
|
284
|
-
# def test_windows1252_roundtrip
|
285
|
-
# end
|
286
|
-
end
|
287
|
-
|
288
|
-
|