diff --git a/Gemfile.lock b/Gemfile.lock index 5123043..3ceae31 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,31 +7,85 @@ PATH GEM remote: http://rubygems.org/ specs: - builder (3.0.0) - diff-lcs (1.1.2) - fuubar (0.0.5) - rspec (~> 2.0) - rspec-instafail (~> 0.1.4) - ruby-progressbar (~> 0.0.10) - rake (0.8.7) - rspec (2.6.0) - rspec-core (~> 2.6.0) - rspec-expectations (~> 2.6.0) - rspec-mocks (~> 2.6.0) - rspec-core (2.6.4) - rspec-expectations (2.6.0) - diff-lcs (~> 1.1.2) - rspec-instafail (0.1.8) - rspec-mocks (2.6.0) - ruby-progressbar (0.0.10) - yard (0.7.2) + addressable (2.3.6) + backports (3.6.4) + builder (3.2.2) + byebug (3.5.1) + columnize (~> 0.8) + debugger-linecache (~> 1.2) + slop (~> 3.6) + coderay (1.1.0) + columnize (0.8.9) + debugger-linecache (1.2.0) + diff-lcs (1.2.5) + ethon (0.7.1) + ffi (>= 1.3.0) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.9.1) + faraday (>= 0.7.4, < 0.10) + ffi (1.9.6) + fuubar (1.3.3) + rspec (>= 2.14.0, < 3.1.0) + ruby-progressbar (~> 1.4) + gh (0.13.2) + addressable + backports + faraday (~> 0.8) + multi_json (~> 1.0) + net-http-persistent (>= 2.7) + net-http-pipeline + highline (1.6.21) + json (1.8.1) + launchy (2.4.3) + addressable (~> 2.3) + method_source (0.8.2) + multi_json (1.10.1) + multipart-post (2.0.0) + net-http-persistent (2.9.4) + net-http-pipeline (1.0.1) + pry (0.9.12.6) + coderay (~> 1.0) + method_source (~> 0.8) + slop (~> 3.4) + pusher-client (0.6.0) + json + websocket (~> 1.0) + rake (10.3.2) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.8) + rspec-expectations (2.14.5) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.6) + ruby-progressbar (1.7.0) + slop (3.6.0) + travis (1.7.4) + addressable (~> 2.3) + backports + faraday (~> 0.9) + faraday_middleware (~> 0.9, >= 0.9.1) + gh (~> 0.13) + highline (~> 1.6) + launchy (~> 2.1) + pry (~> 0.9, < 0.10) + pusher-client (~> 0.4) + typhoeus (~> 0.6, >= 0.6.8) + typhoeus (0.6.9) + ethon (>= 0.7.1) + websocket (1.2.1) + yard (0.8.7.6) PLATFORMS ruby DEPENDENCIES active_pdftk! + byebug fuubar rake (>= 0.8.7) - rspec (~> 2.6.0) + rspec (~> 2.14.0) + travis yard diff --git a/active_pdftk.gemspec b/active_pdftk.gemspec index f672960..90f5c75 100644 --- a/active_pdftk.gemspec +++ b/active_pdftk.gemspec @@ -15,10 +15,12 @@ Gem::Specification.new do |s| s.rubyforge_project = "active_pdftk" s.add_dependency 'builder', '>= 2.1.2' - s.add_development_dependency 'rspec', '~> 2.6.0' + s.add_development_dependency 'rspec', '~> 2.14.0' s.add_development_dependency 'rake', '>= 0.8.7' s.add_development_dependency 'yard' + s.add_development_dependency 'travis' s.add_development_dependency 'fuubar' + s.add_development_dependency 'byebug' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") diff --git a/spec/active_pdftk/call_spec.rb b/spec/active_pdftk/call_spec.rb index dc933a2..0c436a6 100644 --- a/spec/active_pdftk/call_spec.rb +++ b/spec/active_pdftk/call_spec.rb @@ -183,17 +183,23 @@ end it "should output without exception and give the appropriate result" do + @data_dump_regexp = /^InfoKey:\s(.+)\nInfoValue:\s(.+)/ @data_string = File.new(path_to_pdf('call/fields.data')).read + @data_hash = Hash[@data_string.scan(@data_dump_regexp)] expect{ @pdftk.pdftk(:input => path_to_pdf('spec.fields.pdf'), :operation => :dump_data, :output => @tempfile) }.to_not raise_error(ActivePdftk::CommandError) @tempfile.rewind - @tempfile.read.should == @data_string + @tempfile_string = @tempfile.read + @tempfile_hash = Hash[@tempfile_string.scan(@data_dump_regexp)] + @tempfile_hash.should == @data_hash expect{ @pdftk.pdftk(:input => path_to_pdf('spec.fields.pdf'), :operation => :dump_data, :output => @stringio) }.to_not raise_error(ActivePdftk::CommandError) - @stringio.string.should == @data_string + @stringio_hash = Hash[@stringio.string.scan(@data_dump_regexp)] + @stringio_hash.should == @data_hash - expect{@return_stringio = @pdftk.pdftk(:input => path_to_pdf('spec.fields.pdf'), :operation => :dump_data) }.to_not raise_error(ActivePdftk::CommandError) - @return_stringio.string.should == @data_string + expect{@return_stringio = @pdftk.pdftk(:input => path_to_pdf('spec.fields.pdf'), :operation => :dump_data) }.to_not raise_error(ActivePdftk::CommandError) + @return_stringio_hash = Hash[@return_stringio.string.scan(@data_dump_regexp)] + @return_stringio_hash.should == @data_hash end it "should input a File, output a StringIO without exception and give the appropriate result" do diff --git a/spec/support/matchers/content_matcher.rb b/spec/support/matchers/content_matcher.rb index d8d7d4d..032bb07 100644 --- a/spec/support/matchers/content_matcher.rb +++ b/spec/support/matchers/content_matcher.rb @@ -1,3 +1,4 @@ +require 'digest' RSpec::Matchers.define :have_the_content_of do |expected| match do |actual| puts actual.class.name.to_s