spec/persevere_adapter_spec.rb in dm-persevere-adapter-0.23.0 vs spec/persevere_adapter_spec.rb in dm-persevere-adapter-0.25.0
- old
+ new
@@ -6,10 +6,12 @@
agg_dir = path_to("dm-aggregates", "0.10.2")[0]
require agg_dir / 'spec' / 'public' / 'shared' / 'aggregate_shared_spec'
require Pathname(__FILE__).dirname.expand_path.parent + 'lib/persevere_adapter'
+require 'ruby-debug'
+
describe DataMapper::Adapters::PersevereAdapter do
before :all do
# This needs to point to a valid persevere server
@adapter = DataMapper.setup(:default, { :adapter => 'persevere', :host => 'localhost', :port => '8080' })
@repository = DataMapper.repository(@adapter.name)
@@ -63,11 +65,11 @@
describe 'migrations' do
it 'should create the Bozon storage' do
Bozon.auto_migrate!
Bozon.auto_migrate_down!
end
-
+
it "should destroy Create then Remove the Bozon Storage" do
@adapter.get_schema(Bozon.storage_name).should == false
Bozon.auto_migrate_up!
@adapter.get_schema(Bozon.storage_name).should_not == false
Bozon.auto_migrate_down!
@@ -88,30 +90,20 @@
end
end
describe '#get_schema' do
it 'should return all of the schemas (in json) if no name is provided' do
+ # debugger
result = @adapter.get_schema()
result.should_not == false
- JSON.parse(result).class.should == Array
+ result.class.should == Array
end
it 'should return the json schema of the class specified' do
result = @adapter.get_schema("Object")
result.should_not == false
- JSON.parse(result)["id"].should == "Object"
+ result["id"].should == "Object"
end
-
- # I don't think we need these tests.
- # it 'should return all of the schemas (in json) for a project if no name is provided' do
- # result = @adapter.get_schema(nil, "Class")
- # debugger
- # result
- # end
- #
- # it 'should return all of the schemas (in json) if no name is provided' do
- # @adapter.get_schema("Object", "Class")
- # end
end
describe '#update_schema' do
it 'should update a previously existing schema' do
result = @adapter.update_schema(@test_schema_hash_mod)