Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed all non-passing tests in call_spec #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ 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)
builder (3.2.2)
diff-lcs (1.2.5)
fuubar (1.3.3)
rspec (>= 2.14.0, < 3.1.0)
ruby-progressbar (~> 1.4)
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)
yard (0.8.7.6)

PLATFORMS
ruby
Expand All @@ -33,5 +31,5 @@ DEPENDENCIES
active_pdftk!
fuubar
rake (>= 0.8.7)
rspec (~> 2.6.0)
rspec (~> 2.14.0)
yard
2 changes: 1 addition & 1 deletion active_pdftk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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 'fuubar'
Expand Down
14 changes: 10 additions & 4 deletions spec/active_pdftk/call_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/inputs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def fixtures_path(entry, expand = false)
if expand && entry_path.directory?
entry_path.children
else
entry_path
entry_path.to_s
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/support/matchers/content_matcher.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'digest'
RSpec::Matchers.define :have_the_content_of do |expected|
match do |actual|
puts actual.class.name.to_s
Expand Down