1
0
Fork 0
mirror of https://github.com/nov/fb_graph2 synced 2023-03-27 23:22:15 -04:00

node subclass spec

This commit is contained in:
nov 2014-05-05 23:45:29 +09:00
parent 0c607111de
commit 4c682fd6bc
4 changed files with 30 additions and 5 deletions

View file

@ -17,7 +17,7 @@ module FbGraph2
def assign(attributes)
self.raw_attributes = attributes
self.class.registered_attributes.each do |type, keys|
Array(self.class.registered_attributes).each do |type, keys|
keys.each do |key|
raw = attributes[key]
if raw.present?

View file

@ -0,0 +1,23 @@
require 'spec_helper'
module FbGraph2
class NodeSubClass < Node
end
end
describe FbGraph2::NodeSubClass do
let(:klass) { FbGraph2::NodeSubClass }
let(:instance) { klass.new 'identifier' }
context 'class' do
subject { klass }
it { should respond_to :register_attributes }
it { should respond_to :registered_attributes }
it { should respond_to :registered_attributes= }
end
context 'instance' do
subject { instance }
it { should respond_to :assign }
end
end

View file

@ -0,0 +1,5 @@
require 'spec_helper'
describe FbGraph2::Page do
it :TODO
end

View file

@ -1,8 +1,5 @@
require 'spec_helper'
describe FbGraph2::User do
it do
p FbGraph2::User, FbGraph2::User.registered_attributes
p FbGraph2::Page, FbGraph2::Page.registered_attributes
end
it :TODO
end