diff --git a/README.rdoc b/README.rdoc index d622cdf..72cc285 100644 --- a/README.rdoc +++ b/README.rdoc @@ -60,3 +60,6 @@ You can also retrieve a book's full metadata details. # or an array of authors book_view.authors +== TO DO + +Write Tests diff --git a/Rakefile b/Rakefile index 2995527..ec37e30 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,4 @@ require "bundler/gem_tasks" +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new('spec') + diff --git a/lib/openlibrary.rb b/lib/openlibrary.rb index 57a36e2..bdde907 100644 --- a/lib/openlibrary.rb +++ b/lib/openlibrary.rb @@ -7,4 +7,9 @@ module Openlibrary autoload :Data, 'openlibrary/data' autoload :View, 'openlibrary/view' + def self.version_string + "Openlibrary version #{Openlibrary::VERSION}" + end + + end diff --git a/spec/openlibrary_spec.rb b/spec/openlibrary_spec.rb new file mode 100644 index 0000000..28afe5d --- /dev/null +++ b/spec/openlibrary_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe Openlibrary do + it 'should return correct version string' do + Openlibrary.version_string.should == "Openlibrary version #{Openlibrary::VERSION}" + end +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..de5ed88 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,8 @@ +require 'rspec' +require 'openlibrary' + +RSpec.configure do |config| + config.color_enabled = true + config.formatter = 'documentation' +end +