Permalink
Browse files

Revealed method should not bind to an instance.

Test from Gregory Brown.
  • Loading branch information...
1 parent 213e073 commit c41c8914bec84f0009869e96ad6ebb39987896d3 @jimweirich jimweirich committed Feb 2, 2009
Showing with 309 additions and 0 deletions.
  1. +297 −0 TAGS
  2. +12 −0 test/test_blankslate.rb
View
297 TAGS
@@ -0,0 +1,297 @@
+
+doc/jamis.rb,43
+module RDocRDoc1,0
+module PagePage2,12
+
+lib/blankslate.rb,455
+class BlankSlateBlankSlate17,621
+ def hide(name)hide22,788
+ def find_hidden_method(name)find_hidden_method31,1032
+ def reveal(name)reveal38,1268
+module KernelKernel55,1902
+ def method_added(name)method_added61,2078
+class ObjectObject73,2357
+ def method_added(name)method_added79,2532
+ def find_hidden_method(name)find_hidden_method86,2693
+class ModuleModule99,3124
+ def append_features(mod)append_features101,3197
+
+lib/builder/blankslate.rb,30
+module BuilderBuilder18,555
+
+lib/builder/css.rb,1102
+module BuilderBuilder23,757
+ class CSS < BlankSlateCSS92,2139
+ def initialize(indent=2)initialize101,2424
+ def +(part)+108,2562
+ def >>(part)>>113,2623
+ def >(part)>118,2684
+ def |(part)|123,2745
+ def target!target!129,2845
+ def comment!(comment_text)comment!134,2934
+ def id!(arg, &block)id!138,3017
+ def class!(arg, &block)class!145,3170
+ def store!(sym, &block)store!152,3326
+ def group!(*args, &block)group!156,3399
+ def method_missing(sym, *args, &block)method_missing171,3712
+ def nil?nil?190,4216
+ def _unify_block_unify_block195,4262
+ def _join_with_op!(op)_join_with_op!200,4343
+ def _text(text)_text205,4464
+ def _css_block(block)_css_block209,4514
+ def _end_block_end_block216,4634
+ def _newline_newline221,4696
+ def _indent_indent225,4743
+ def _nested_structures(block)_nested_structures229,4794
+ def _start_container(sym, atts = {}, with_bracket = true)_start_container235,4917
+ def _end_container_end_container242,5192
+ def _css_line(sym, *args)_css_line246,5244
+
+lib/builder/xchar.rb,342
+module BuilderBuilder11,321
+ def self.check_for_name_collision(klass, method_name, defined_constant=nil)check_for_name_collision12,336
+module BuilderBuilder26,798
+ module XChar # :nodoc:XChar32,997
+class FixnumFixnum89,2948
+ def xchr(escape=true)xchr95,3179
+class StringString110,3542
+ def to_xs(escape=true)to_xs114,3727
+
+lib/builder/xmlbase.rb,639
+module BuilderBuilder5,51
+ class IllegalBlockError < RuntimeError; endIllegalBlockError8,97
+ class XmlBase < BlankSlateXmlBase12,264
+ def initialize(indent=0, initial=0, encoding='utf-8')initialize24,777
+ def tag!(sym, *args, &block)tag!33,1109
+ def method_missing(sym, *args, &block)method_missing40,1366
+ def text!(text)text!83,2417
+ def <<(text)<<100,3077
+ def nil?nil?110,3508
+ def _escape(text)_escape117,3587
+ def _escape_quote(text)_escape_quote121,3679
+ def _newline_newline125,3768
+ def _indent_indent130,3844
+ def _nested_structures(block)_nested_structures135,3955
+
+lib/builder/xmlevents.rb,216
+module BuilderBuilder14,315
+ class XmlEvents < XmlMarkupXmlEvents48,1598
+ def text!(text)text!49,1628
+ def _start_tag(sym, attrs, end_too=false)_start_tag53,1682
+ def _end_tag(sym)_end_tag58,1804
+
+lib/builder/xmlmarkup.rb,775
+module BuilderBuilder16,425
+ class XmlMarkup < XmlBaseXmlMarkup160,5942
+ def initialize(options={})initialize185,6995
+ def target!target!193,7220
+ def comment!(comment_text)comment!197,7259
+ def declare!(inst, *args, &block)declare!208,7555
+ def instruct!(directive_tag=:xml, attrs={})instruct!241,8433
+ def cdata!(text)cdata!263,9017
+ def _text(text)_text274,9341
+ def _special(open, close, data=nil, attrs=nil, order=[])_special279,9431
+ def _start_tag(sym, attrs, end_too=false)_start_tag290,9765
+ def _end_tag(sym)_end_tag298,9964
+ def _insert_attributes(attrs, order=[])_insert_attributes303,10073
+ def _attr_value(value)_attr_value314,10388
+ def _ensure_no_block(got_block)_ensure_no_block323,10533
+
+lib/builder.rb,0
+
+scripts/publish.rb,0
+
+test/performance.rb,45
+ def XmlMarkup._escape(text)_escape19,385
+
+test/preload.rb,148
+module KernelKernel7,179
+ def method_added(name)method_added11,294
+class ObjectObject19,430
+ def method_added(name)method_added23,544
+
+test/test_blankslate.rb,2689
+module LateObjectLateObject9,168
+ def late_objectlate_object10,186
+ def LateObject.included(mod)included13,217
+module LateKernelLateKernel20,403
+ def late_kernellate_kernel21,421
+ def LateKernel.included(mod)included24,452
+module KernelKernel32,663
+ def late_additionlate_addition35,699
+ def double_late_additiondouble_late_addition39,735
+ def double_late_additiondouble_late_addition43,776
+class Object Object51,902
+ def another_late_additionanother_late_addition53,937
+module GlobalModuleGlobalModule59,1029
+ def global_inclusionglobal_inclusion60,1049
+def direct_globaldirect_global66,1108
+class TestBlankSlate < Test::Unit::TestCaseTestBlankSlate73,1238
+ def setupsetup74,1282
+ def test_undefined_methods_remain_undefinedtest_undefined_methods_remain_undefined78,1326
+ def test_undefined_methods_remain_undefined_during_instance_evaltest_undefined_methods_remain_undefined_during_instance_eval86,1610
+ def test_private_methods_are_undefinedtest_private_methods_are_undefined95,1876
+ def test_targetted_private_methods_are_undefined_during_instance_evaltest_targetted_private_methods_are_undefined_during_instance_eval101,1989
+ def test_untargetted_private_methods_are_defined_during_instance_evaltest_untargetted_private_methods_are_defined_during_instance_eval107,2170
+ def test_methods_added_late_to_kernel_remain_undefinedtest_methods_added_late_to_kernel_remain_undefined117,2385
+ def test_methods_added_late_to_object_remain_undefinedtest_methods_added_late_to_object_remain_undefined122,2544
+ def test_methods_added_late_to_global_remain_undefinedtest_methods_added_late_to_global_remain_undefined127,2721
+ def test_preload_method_addedtest_preload_method_added132,2880
+ def test_method_defined_late_multiple_times_remain_undefinedtest_method_defined_late_multiple_times_remain_undefined137,3041
+ def test_late_included_module_in_object_is_oktest_late_included_module_in_object_is_ok142,3218
+ def test_late_included_module_in_kernel_is_oktest_late_included_module_in_kernel_is_ok147,3360
+ def test_revealing_previously_hidden_methods_are_callabletest_revealing_previously_hidden_methods_are_callable151,3467
+ def test_revealing_previously_hidden_methods_are_callable_with_blocktest_revealing_previously_hidden_methods_are_callable_with_block158,3649
+ def given_block(&block)given_block160,3749
+ def test_revealing_a_hidden_method_twice_is_oktest_revealing_a_hidden_method_twice_is_ok171,3961
+ def test_revealing_unknown_hidden_method_is_an_errortest_revealing_unknown_hidden_method_is_an_error179,4151
+ def test_global_includes_still_worktest_global_includes_still_work187,4317
+
+test/test_cssbuilder.rb,973
+class TestCSS < Test::Unit::TestCaseTestCSS8,105
+ def setupsetup9,142
+ def test_createtest_create13,189
+ def test_no_blocktest_no_block17,238
+ def test_blocktest_block22,317
+ def test_idtest_id29,451
+ def test_classtest_class34,574
+ def test_elem_with_idtest_elem_with_id39,703
+ def test_elem_with_classtest_elem_with_class44,846
+ def test_commenttest_comment49,995
+ def test_selectortest_selector54,1091
+ def test_plustest_plus59,1222
+ def test_plus_with_blocktest_plus_with_block64,1312
+ def test_contextualtest_contextual69,1457
+ def test_contextual_with_blocktest_contextual_with_block74,1553
+ def test_childtest_child79,1704
+ def test_child_with_blocktest_child_with_block84,1795
+ def test_multiple_optest_multiple_op89,1941
+ def test_alltest_all94,2057
+ def test_all_with_attstest_all_with_atts99,2186
+ def test_multiple_basictest_multiple_basic104,2367
+ def test_multiple_opstest_multiple_ops110,2556
+
+test/test_eventbuilder.rb,655
+class TestEvents < Test::Unit::TestCaseTestEvents1,0
+ class TargetTarget3,41
+ def initializeinitialize6,81
+ def start_tag(tag, attrs)start_tag10,128
+ def end_tag(tag)end_tag14,209
+ def text(string)text18,276
+ def setupsetup25,351
+ def test_simpletest_simple30,447
+ def test_nestedtest_nested37,564
+ def test_texttest_text46,757
+ def test_special_texttest_special_text54,901
+ def test_text_with_entitytest_text_with_entity62,1057
+ def test_attributestest_attributes70,1225
+ def test_moderately_complextest_moderately_complex77,1377
+ def expect(value)expect125,2645
+ def expect_doneexpect_done129,2717
+
+test/test_markupbuilder.rb,5123
+class TestMarkup < Test::Unit::TestCaseTestMarkup18,449
+ def setupsetup19,489
+ def test_createtest_create23,542
+ def test_simpletest_simple27,591
+ def test_valuetest_value32,675
+ def test_nestedtest_nested37,771
+ def test_attributestest_attributes42,897
+ def test_string_attributes_are_quoted_by_defaulttest_string_attributes_are_quoted_by_default47,999
+ def test_symbol_attributes_are_unquoted_by_defaulttest_symbol_attributes_are_unquoted_by_default52,1138
+ def test_attributes_quoted_can_be_turned_ontest_attributes_quoted_can_be_turned_on57,1284
+ def test_mixed_attribute_quoting_with_nested_builderstest_mixed_attribute_quoting_with_nested_builders63,1490
+ def test_multiple_attributestest_multiple_attributes72,1772
+ def test_attributes_with_texttest_attributes_with_text77,1921
+ def test_complextest_complex82,2090
+ def test_funky_symboltest_funky_symbol89,2281
+ def test_tag_can_handle_private_methodtest_tag_can_handle_private_method94,2445
+ def test_no_explicit_markertest_no_explicit_marker99,2596
+ def test_reference_local_varstest_reference_local_vars104,2712
+ def test_reference_methodstest_reference_methods110,2874
+ def test_append_texttest_append_text115,3017
+ def test_ambiguous_markuptest_ambiguous_markup120,3139
+ def test_capitalized_methodtest_capitalized_method128,3330
+ def test_escapingtest_escaping133,3499
+ def test_non_escapingtest_non_escaping138,3659
+ def test_return_valuetest_return_value143,3851
+ def test_stacked_builderstest_stacked_builders148,3941
+ def namename154,4165
+class TestAttributeEscaping < Test::Unit::TestCaseTestAttributeEscaping159,4197
+ def setupsetup161,4249
+ def test_element_gttest_element_gt165,4302
+ def test_element_amptest_element_amp170,4408
+ def test_element_amp2test_element_amp2175,4518
+ def test_attr_lesstest_attr_less180,4631
+ def test_attr_amptest_attr_amp185,4740
+ def test_attr_quottest_attr_quot190,4851
+class TestNameSpaces < Test::Unit::TestCaseTestNameSpaces197,4972
+ def setupsetup198,5016
+ def test_simple_name_spacestest_simple_name_spaces202,5081
+ def test_longtest_long207,5182
+class TestDeclarations < Test::Unit::TestCaseTestDeclarations233,5885
+ def setupsetup234,5931
+ def test_declaretest_declare238,5996
+ def test_bare_argtest_bare_arg243,6095
+ def test_string_argtest_string_arg248,6204
+ def test_mixed_argstest_mixed_args253,6326
+ def test_nested_declarationstest_nested_declarations258,6518
+ def test_nested_indented_declarationstest_nested_indented_declarations266,6789
+ def test_complex_declarationtest_complex_declaration273,7043
+class TestSpecialMarkup < Test::Unit::TestCaseTestSpecialMarkup290,7479
+ def setupsetup291,7526
+ def test_commenttest_comment295,7591
+ def test_indented_commenttest_indented_comment300,7698
+ def test_instructtest_instruct305,7827
+ def test_indented_instructtest_indented_instruct310,7954
+ def test_instruct_without_attributestest_instruct_without_attributes316,8122
+ def test_xml_instructtest_xml_instruct321,8233
+ def test_xml_instruct_with_overridestest_xml_instruct_with_overrides326,8359
+ def test_xml_instruct_with_standalongtest_xml_instruct_with_standalong331,8525
+ def test_no_blockstest_no_blocks336,8729
+ def test_cdatatest_cdata345,8948
+ def test_cdata_with_ampersandtest_cdata_with_ampersand350,9048
+class TestIndentedXmlMarkup < Test::Unit::TestCaseTestIndentedXmlMarkup356,9179
+ def setupsetup357,9230
+ def test_one_leveltest_one_level361,9295
+ def test_two_levelstest_two_levels366,9419
+ def test_initial_leveltest_initial_level374,9599
+ class TestUtfMarkup < Test::Unit::TestCaseTestUtfMarkup380,9823
+ def setupsetup381,9868
+ def teardownteardown385,9917
+ def test_use_entities_if_no_encoding_is_given_and_kcode_is_nonetest_use_entities_if_no_encoding_is_given_and_kcode_is_none389,9969
+ def test_use_entities_if_encoding_is_utf_but_kcode_is_nottest_use_entities_if_encoding_is_utf_but_kcode_is_not396,10185
+ def test_use_entities_if_kcode_is_utf_but_encoding_is_something_elsetest_use_entities_if_kcode_is_utf_but_encoding_is_something_else404,10443
+ def test_use_utf8_if_encoding_defaults_and_kcode_is_utf8test_use_utf8_if_encoding_defaults_and_kcode_is_utf8412,10713
+ def test_use_utf8_if_both_encoding_and_kcode_are_utf8test_use_utf8_if_both_encoding_and_kcode_are_utf8419,10922
+ def test_use_utf8_if_both_encoding_and_kcode_are_utf8_with_lowercasetest_use_utf8_if_both_encoding_and_kcode_are_utf8_with_lowercase427,11179
+ class TestXmlEvents < Test::Unit::TestCaseTestXmlEvents436,11457
+ def setupsetup437,11502
+ def test_simpletest_simple442,11613
+ def test_texttest_text448,11767
+ def test_attributestest_attributes455,11981
+ def test_indentedtest_indented463,12200
+ def pop_textpop_text475,12659
+ class EventHandlerEventHandler484,12853
+ def initializeinitialize486,12902
+ def start_tag(sym, attrs)start_tag490,12954
+ def end_tag(sym)end_tag494,13030
+ def text(txt)text498,13088
+
+test/test_namecollision.rb,286
+class TestNameCollisions < Test::Unit::TestCaseTestNameCollisions6,66
+ module CollideCollide7,114
+ def xchrxchr8,131
+ def test_no_collisiontest_no_collision12,159
+ def test_collisiontest_collision18,289
+ def test_collision_with_symboltest_collision_with_symbol24,414
+
+test/test_xchar.rb,355
+class TestXmlEscaping < Test::Unit::TestCaseTestXmlEscaping6,66
+ def test_asciitest_ascii7,111
+ def test_predefinedtest_predefined11,171
+ def test_invalidtest_invalid17,402
+ def test_iso_8859_1test_iso_8859_123,603
+ def test_win_1252test_win_125228,767
+ def test_utf8test_utf833,913
+ def test_utf8_verbatimtest_utf8_verbatim38,1063
@@ -192,5 +192,17 @@ def test_global_includes_still_work
assert_equal 43, direct_global
end
end
+
+ def test_reveal_should_not_bind_to_an_instance
+ with_object_id = Class.new(BlankSlate) do
+ reveal(:object_id)
+ end
+
+ obj1 = with_object_id.new
+ obj2 = with_object_id.new
+
+ assert obj1.object_id != obj2.object_id,
+ "Revealed methods should not be bound to a particular instance"
+ end
end

0 comments on commit c41c891

Please sign in to comment.