Sha256: 222a3b83567e7bf7cc6a163ce684f3fe23a5eea0d7210d6f9b9142866ebd8c87
Contents?: true
Size: 1.36 KB
Versions: 15
Compression:
Stored size: 1.36 KB
Contents
require 'spec_helper' require 'proxy_pac_rb/rspec' RSpec.describe 'Validity', type: :proxy_pac do subject do <<-EOS.strip_heredoc.chomp function FindProxyForURL(url, host) { return "DIRECT"; } EOS end context 'when is valid' do it { expect(proxy_pac).to be_valid } context 'although it makes URI to raise invalid url error' do subject do <<-EOS.strip_heredoc.chomp function FindProxyForURL(url, host) { // comment if ( dnsDomainIs ( host, "example.org") ) { return "PROXY 10.0.0.0:8080"; } } EOS end it { expect(proxy_pac).to be_valid } end end context 'when is not valid' do context 'when is not readable' do subject { 'function Gargabe' } it { expect(proxy_pac).not_to be_valid } end context 'when contains gargabe' do subject do <<-EOS.strip_heredoc.chomp function FindProxyForURL(url, host) { return $ยง"% "DIRECT"; } EOS end it { expect(proxy_pac).not_to be_valid } end context 'when undefined variable is referenced' do subject do <<-EOS.strip_heredoc.chomp function FindProxyForURL(url, host) { return asdf; } EOS end it { expect(proxy_pac).not_to be_valid } end end end
Version data entries
15 entries across 15 versions & 1 rubygems