Permalink
Browse files

Working on primitive carcass

Cucumbering the very basic behavior.
  • Loading branch information...
argent-smith committed Sep 12, 2011
1 parent 22aec54 commit bf010f6f3387390c1b571ba21fc4d44a4c3bd36e
@@ -0,0 +1,12 @@
Feature: Ping the server
In order to check if SIP server is alive
As a server admin
I want to see any kind of response from the server
Scenario: Try to register
Given I've instantiated the SIP client
And I've entered server's address
And I've entered SIP login
And I've entered SIP password
When I send REGISTER message
Then I should get a result from server
@@ -0,0 +1,24 @@
Given /^I've instantiated the SIP client$/ do
@client = Sirup::SIP::Client.new
end
Given /^I've entered server's address$/ do
@client.server = "sip.rtelekom.net"
end
Given /^I've entered SIP login$/ do
@client.login = "sirup"
end
Given /^I've entered SIP password$/ do
@client.password = "1FDQDGYo"
end
When /^I send REGISTER message$/ do
@client.sendRequest :register
end
Then /^I should get a result from server$/ do
@client.response.code.should exist
end
View
@@ -1,2 +1,4 @@
require 'rubygems'
require 'bundler/setup'
require 'bundler/setup'
require 'sirup'
View
@@ -1,5 +1,7 @@
$:.unshift File.dirname __FILE__
require "sirup/version"
require "sirup/sip"
module Sirup
# Your code goes here...
end
View
@@ -0,0 +1,6 @@
$:.unshift File.dirname __FILE__
require 'sip/client'
# This module envelopes SIP protocol implementaton.
module SIP
end
View
@@ -0,0 +1,21 @@
$:.unshift File.dirname __FILE__
require 'response'
module Sirup
module SIP
# SIP client implementation
class Client
attr_accessor :server, :login, :password
attr_reader :response
def initialize
@response = Response.new
end
def sendRequest req
end
end
end
end
@@ -0,0 +1,9 @@
module Sirup
module SIP
# SIP server response
class Response
attr_reader :code
end
end
end
View
@@ -16,7 +16,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
# specify any dependencies here; for example:
s.add_development_dependency "rake"
s.add_development_dependency "rspec"
s.add_development_dependency "bddgen"

0 comments on commit bf010f6

Please sign in to comment.