Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add specs

  • Loading branch information...
commit 8be2f2b11988bb130d7bfc9cf2cc885c61fb7156 1 parent 59ecdd1
@schorsch schorsch authored
View
1  lib/happypdf/schema.rb
@@ -6,7 +6,6 @@ class Schema
# @param [String] version folder name to use
def self.path(version='v1.0')
File.expand_path( File.join('../../schema', version), File.dirname(__FILE__))
- #File.expand_path( File.join(File.dirname(__FILE__), '../../schema', version) )
end
end
end
View
2  lib/happypdf/version.rb
@@ -1,5 +1,5 @@
module HappyPdf
class Schema
- VERSION='0.0.1'
+ VERSION='0.0.2'
end
end
View
22 spec/happypdf_schema_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe HappyPdf::Schema do
+
+ context 'path' do
+ it 'should provide path to schema files' do
+ HappyPdf::Schema.path.should == File.expand_path( File.join('../schema/v1.0'), File.dirname(__FILE__))
+ end
+ end
+
+ context 'read schemata' do
+
+ it 'should read all json files' do
+ SchemaTools.schema_path = HappyPdf::Schema.path
+ SchemaTools::Reader.read_all
+ SchemaTools::Reader.registry.should_not be_empty
+ end
+
+ end
+
+
+end
View
10 spec/spec_helper.rb
@@ -0,0 +1,10 @@
+# encoding: utf-8
+$:.unshift(File.dirname(__FILE__))
+$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'rspec'
+require 'json_schema_tools'
+require 'happypdf_json_schema'
+
+RSpec.configure do |config|
+end
Please sign in to comment.
Something went wrong with that request. Please try again.