示例#1
0
    void test_clear_by_name() {
        Selector* sel = Selector::lookup(state, state->symbol("foo"));
        SendSite* ss = SendSite::create(state, sel->name());

        sel->associate(state, ss);
        Selector::clear_by_name(state, state->symbol("foo"));
    }
示例#2
0
  Selector* Selector::create(STATE, Object* name) {
    Selector* sel = state->new_object<Selector>(G(selector));
    sel->name(state, (Symbol*)name);
    sel->send_sites(state, Array::create(state, 1));

    return sel;
  }
示例#3
0
 void test_create() {
     Object* sym = state->symbol("blah");
     Selector* sel = Selector::create(state, sym);
     TS_ASSERT_EQUALS(sel->name(), sym);
     TS_ASSERT(sel->send_sites()->kind_of_p(state, G(array)));
 }