summaryrefslogtreecommitdiffhomepage
path: root/spec/component_manager_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/component_manager_spec.rb')
-rw-r--r--spec/component_manager_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/component_manager_spec.rb b/spec/component_manager_spec.rb
index 1c732ac..d99d744 100644
--- a/spec/component_manager_spec.rb
+++ b/spec/component_manager_spec.rb
@@ -84,6 +84,15 @@ describe 'Components' do
end
it 'cant overwrite exiting component managers' do
- expect { FelFlame::Components.new('TestComponents') }.to raise_error(NameError)
+ FelFlame::Components.new('TestComponent1')
+ expect { FelFlame::Components.new('TestComponent1') }.to raise_error(NameError)
+ end
+
+ it 'can\'t create an attribute when its name is an existing method' do
+ expect { FelFlame::Components.new('TestComponent2', :id) }.to raise_error(NameError)
+ expect { FelFlame::Components.new('TestComponent2', :addition_triggers) }.to raise_error(NameError)
+ expect { FelFlame::Components.new('TestComponent2', :removal_triggers) }.to raise_error(NameError)
+ expect { FelFlame::Components.new('TestComponent2', :attr_triggers) }.to raise_error(NameError)
+ expect { FelFlame::Components.new('TestComponent3', :same, :same) }.to raise_error(NameError)
end
end