Sha256: 4637fbc42588423f0c98f11aaad6e79da87960d6a0437f96a2304f71efbbb2b5

Contents?: true

Size: 599 Bytes

Versions: 6

Compression:

Stored size: 599 Bytes

Contents

describe YAML do
  context '#escape' do
    it 'uses the expected Ruby version' do
      expect(RUBY_VERSION).to eq '2.1.6'
    end

    it 'uses the expected YAML version' do
      expect(YAML::VERSION).to eq '2.0.5' # The escaping below changes with different YAML versions
    end

    it 'correctly escape a basic string' do
      expect(YAML.escape 'brian').to eq('brian')
    end

    it 'correctly escape a troublesome string' do
      expect(YAML.escape '{{moustache}} beard').to eq('"{{moustache}} beard"')
      expect(YAML.escape "Brian O'Brien").to eq("Brian O'Brien")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreplay-0.13.5 spec/lib/yaml_spec.rb
foreplay-0.13.4 spec/lib/yaml_spec.rb
foreplay-0.13.3 spec/lib/yaml_spec.rb
foreplay-0.13.2 spec/lib/yaml_spec.rb
foreplay-0.13.1 spec/lib/yaml_spec.rb
foreplay-0.13.0 spec/lib/yaml_spec.rb