spec/citeproc/variable_spec.rb in citeproc-0.0.8 vs spec/citeproc/variable_spec.rb in citeproc-0.0.9

- old
+ new

@@ -22,20 +22,15 @@ Variable.new('test').should == 'test' end it 'accepts a numeric value' do Variable.new(23).should == '23' - Variable.new(23.1).should == '23.1' end - # it 'raises type error when initialized with a hash' do - # lambda { Variable.new(:value => 'test') }.should raise_error(TypeError) - # end - - it 'supports self yielding block' do - Variable.new { |v| v.value = 'test' }.should == 'test' - end + it 'accepts a floating point value' do + Variable.new(23.12).should == '23.12' + end end describe '.fields' do it 'contains :names fields' do Variable.fields[:names].should_not be_empty @@ -61,13 +56,10 @@ end end describe '.types' do it 'given a field name returns the corresponding type' do - Variable.types[:author].should == :names - Variable.types[:issued].should == :date - Variable.types[:abstract].should == :text - Variable.types[:issue].should == :number + Variable.types.values_at(:author, :issued, :abstract, :issue).should == [:names, :date, :text, :number] end it 'accepts either string or symbol input' do Variable.types.should have_key(:author) Variable.types['author'].should equal Variable.types[:author] \ No newline at end of file