spec/piglet/field/field_spec.rb in piglet-0.2.5 vs spec/piglet/field/field_spec.rb in piglet-0.3.0

- old
+ new

@@ -7,17 +7,22 @@ describe Field do before do - @field = mock('field') - @field.extend Field + @field = Object.new + @field.extend(Field) + @field.stub(:predecessors).and_return([stub(:generate_field_alias => 'xyz')]) @expressions = {} [:int, :long, :float, :double, :chararray, :bytearray, :bag, :tuple].each do |type| @expressions[type] = mock("#{type} expression") @expressions[type].extend Field @expressions[type].stub!(:type).and_return(type) end + end + + it 'should have an alias' do + @field.field_alias.should_not be_nil end describe '#type' do [:==, :ne, :<, :>, :<=, :>=, :and, :or].each do |op| op_str = (op == :ne ? '!=' : op).to_s.upcase \ No newline at end of file