Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jamesdaniels/455237 to your computer and use it in GitHub Desktop.
Save jamesdaniels/455237 to your computer and use it in GitHub Desktop.
require 'uri'
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
Given(/^a service implementation "([^\"]*)" exists with attributes "([^\"]*)" and first display variable named "([^\"]*)" and second display variable named "([^\"]*)"$/) do |class_name, attributes_string, first_display_var, second_display_var|
begin
klass = Object.const_get(class_name)
rescue NameError
klass = Object.const_set(class_name, Class.new(ServiceImplementation))
aux_variables = attributes_string.split(',').map { |x| x.strip.to_s }
klass.class_eval do
@aux_variables = aux_variables
@first_display_var_name = first_display_var
@second_display_var_name = second_display_var
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment