spec/template/token_spec.rb in klipp-0.2.2.4 vs spec/template/token_spec.rb in klipp-0.2.2.5
- old
+ new
@@ -1,9 +1,8 @@
require 'spec_helper'
describe Template::Token do
-
before do
@token = Template::Token.new
end
it 'has a default string type' do
@@ -13,11 +12,10 @@
it 'will not allow an unknown type' do
expect { @token.type = :invalid_type }.to raise_error RuntimeError
end
context 'with type string' do
-
it 'has a hidden property' do
@token.hidden = true
@token.hidden.should eq true
end
@@ -46,17 +44,16 @@
end
it 'invalidates booleans assigned' do
expect { @token.value = true }.to raise_error RuntimeError
end
-
end
context 'with type bool' do
-
before do
@token.type = :bool
+ @token.default_value = true
end
it 'accepts boolean values' do
@token.value = true
@token.value.should eq true
@@ -92,9 +89,7 @@
end
it 'invalidates other strings' do
expect { @token.value = 'ja' }.to raise_error RuntimeError
end
-
end
-
-end
\ No newline at end of file
+end