Sha256: 9816f3c28347a954b5f80b35648af6df91f7cbe7c1c5c56055ff0f6b65604fbd

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

class SiteHub
  class Cookie
    describe Flag do
      let(:name) { 'flag' }
      let(:string_sanitiser){Object.new.tap{|o|o.extend(StringSanitiser)}}
      subject do
        described_class.new(name)
      end

      describe '#initialize' do
        it 'stores the value as a symbol' do
          expect(subject.name).to eq(name.to_sym)
        end

        it 'sanitises the string parameter' do
          expect(described_class.new("#{name} \n").name).to eq(name.to_sym)
        end
      end

      describe '#to_s' do
        it 'returns the name' do
          expect(subject.to_s).to eq(name)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sitehub-0.4.2 spec/sitehub/cookie/flag_spec.rb
sitehub-0.4.1 spec/sitehub/cookie/flag_spec.rb