Permalink
Browse files

add specs

  • Loading branch information...
schorsch committed Dec 28, 2012
1 parent 59ecdd1 commit 8be2f2b11988bb130d7bfc9cf2cc885c61fb7156
Showing with 33 additions and 2 deletions.
  1. +0 −1 lib/happypdf/schema.rb
  2. +1 −1 lib/happypdf/version.rb
  3. +22 −0 spec/happypdf_schema_spec.rb
  4. +10 −0 spec/spec_helper.rb
View
@@ -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
@@ -1,5 +1,5 @@
module HappyPdf
class Schema
- VERSION='0.0.1'
+ VERSION='0.0.2'
end
end
@@ -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
@@ -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

0 comments on commit 8be2f2b

Please sign in to comment.