Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
Remove the explicit mongoid and sequel generators
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Elliott committed Feb 14, 2011
1 parent 42f0c96 commit 381d480
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 84 deletions.
7 changes: 0 additions & 7 deletions lib/fabrication/generator/mongoid.rb

This file was deleted.

7 changes: 0 additions & 7 deletions lib/fabrication/generator/sequel.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/fabrication/schematic.rb
Expand Up @@ -2,8 +2,6 @@ class Fabrication::Schematic

GENERATORS = [
Fabrication::Generator::ActiveRecord,
Fabrication::Generator::Mongoid,
Fabrication::Generator::Sequel,
Fabrication::Generator::Base
]

Expand Down
17 changes: 17 additions & 0 deletions spec/fabrication/generator/base_spec.rb
Expand Up @@ -71,4 +71,21 @@

end

describe "#after_generation" do
let(:instance) { mock(:instance) }
let(:generator) { Fabrication::Generator::Base.new(Object) }

before { generator.send(:instance=, instance) }

it "saves with a true save flag" do
instance.should_receive(:save!)
generator.send(:after_generation, {:save => true})
end

it "does not save without a true save flag" do
instance.should_not_receive(:save)
generator.send(:after_generation, {})
end
end

end
32 changes: 0 additions & 32 deletions spec/fabrication/generator/mongoid_spec.rb

This file was deleted.

32 changes: 0 additions & 32 deletions spec/fabrication/generator/sequel_spec.rb

This file was deleted.

8 changes: 4 additions & 4 deletions spec/fabrication/schematic_spec.rb
Expand Up @@ -17,13 +17,13 @@
end
end
context "for a mongoid object" do
it "uses the mongoid generator" do
Fabrication::Schematic.new(Author).generator.should == Fabrication::Generator::Mongoid
it "uses the base generator" do
Fabrication::Schematic.new(Author).generator.should == Fabrication::Generator::Base
end
end
context "for a sequel object" do
it "uses the sequel generator" do
Fabrication::Schematic.new(Artist).generator.should == Fabrication::Generator::Sequel
it "uses the base generator" do
Fabrication::Schematic.new(Artist).generator.should == Fabrication::Generator::Base
end
end
end
Expand Down

0 comments on commit 381d480

Please sign in to comment.