Skip to content

Commit

Permalink
dashirizing non value directives key
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasas committed Aug 1, 2014
1 parent 19619e7 commit 0f42aff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lotus/action/cache_control/directives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(name)
end

def to_str
@name
@name.to_s.tr('_', '-')
end

def valid?
Expand Down
9 changes: 9 additions & 0 deletions test/unit/cache_control/directives_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,12 @@
end
end
end

describe 'NonValueDirective' do
describe '#to_str' do
it 'returns as http cache format' do
subject = Lotus::Action::CacheControl::NonValueDirective.new(:no_cache)
subject.to_str.must_equal('no-cache')
end
end
end

0 comments on commit 0f42aff

Please sign in to comment.