spec/session_ssl_spec.rb in patron-0.6.0 vs spec/session_ssl_spec.rb in patron-0.6.1

- old
+ new

@@ -19,10 +19,12 @@ ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ## THE SOFTWARE. ## ## ------------------------------------------------------------------- + + require File.expand_path("./spec") + '/spec_helper.rb' require 'webrick' require 'yaml' require 'base64' require 'fileutils' @@ -265,9 +267,18 @@ response = @session.get("/test") expect(response.status).to be == 200 end end + it "should raise when an unsupported or unknown SSL version is requested" do + ['something', 1].each do |version| + @session.ssl_version = version + expect { + @session.get("/test") + }.to raise_error(Patron::UnsupportedSSLVersion) + end + end + # ------------------------------------------------------------------------ describe 'when debug is enabled' do it 'it should not clobber stderr' do rdev = STDERR.stat.rdev