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

Calling style on a TableFu::Datum should not raise an exception #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/table_fu.rb
Expand Up @@ -365,6 +365,8 @@ def method_missing(method)
col_opts.index(column_name) || false
elsif method.to_s =~ /\?$/ && !opts[method.to_s.chop.to_sym]
nil
elsif method == :style
nil
else
super
end
Expand Down
5 changes: 5 additions & 0 deletions spec/table_fu_spec.rb
Expand Up @@ -58,6 +58,11 @@
@spreadsheet.deleted_rows.length.should eql 5
@spreadsheet.rows.length.should eql 2
end

it 'should not require a style option' do
@spreadsheet.col_opts.delete :style
@spreadsheet.rows[0].columns[0].style.should be_nil
end
end

describe TableFu, 'with a complicated setup' do
Expand Down