From f40ff3e5a100e3269df71fc8f5b891c850a478a1 Mon Sep 17 00:00:00 2001 From: Steve Ross Date: Fri, 3 Jan 2014 11:00:02 -0800 Subject: [PATCH] spec to test against namespace collision #99 --- spec/issue99.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/issue99.rb diff --git a/spec/issue99.rb b/spec/issue99.rb new file mode 100644 index 0000000..be86df9 --- /dev/null +++ b/spec/issue99.rb @@ -0,0 +1,21 @@ +describe "issue99 -- namespacing conflict" do + it "does not raise an error when creating a Collection object" do + class Collection + include MotionModel::Model + include MotionModel::ArrayModelAdapter + columns name: :string + has_many :items, dependent: :destroy + end + class Item + include MotionModel::Model + include MotionModel::ArrayModelAdapter + columns name: :string + belongs_to :collection + end + + c = lambda{ + c = Collection.create(name:'asdf') + c.items.create(name:'qwer') }. + should.not.raise + end +end \ No newline at end of file