Sha256: 6e128756641899f6688e53388b2cca022b4bc7ceb0d02ead7d5fe7783edbc52d

Contents?: true

Size: 659 Bytes

Versions: 10

Compression:

Stored size: 659 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)

require 'hamster/tuple'

describe Hamster::Tuple do

  describe "#to_a" do

    [
      [],
      ["A"],
      ["A", "B", "C"],
    ].each do |values|

      describe "on #{values.inspect}" do

        before do
          @tuple = Hamster::Tuple.new(*values)
          @result = @tuple.to_a
        end

        it "returns #{values.inspect}" do
          @result.should == values
        end

        it "returns a mutable array" do
          @result.last.should_not == "The End"
          @result << "The End"
          @result.last.should == "The End"
        end

      end

    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hamster-0.3.6 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.5 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.4 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.3 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.2 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.1 spec/hamster/tuple/to_a_spec.rb
hamster-0.3.0 spec/hamster/tuple/to_a_spec.rb
hamster-0.2.13 spec/hamster/tuple/to_a_spec.rb
hamster-0.2.12 spec/hamster/tuple/to_a_spec.rb
hamster-0.2.11 spec/hamster/tuple/to_a_spec.rb