Sha256: 42f309a7ca171ab22a1ac279b8d0460c31bc8a4e701ff8461a2f0c5c0598ba01

Contents?: true

Size: 900 Bytes

Versions: 1

Compression:

Stored size: 900 Bytes

Contents

module CukePages

	class Feature

		attr_reader :ref, :title, :friendly_filename, :description ,:scenarios

		def initialize(filename, title, description = "", scenarios = [])
			@ref = filename.split(".feature").first
			@friendly_filename = @ref.gsub(/[_-]/, ' ').capitalize
			@title = title
			@description = description
			@scenarios = scenarios	
		end

		# Support ERB templating of member data.
    	def get_binding
      		binding
    	end

	end

	class Scenario

		attr_reader :title, :steps

		def initialize(title, steps=[])
			@title = title			
			@steps = steps			
		end	

		def to_s
			steps.inject("Scenario: #{title}\n") { |result, step| 
				result << "  " << step.to_s << "\n" 
			}
		end
	
	end	

	class Step

		attr_reader :keyword, :action

		def initialize(keyword, action)
			@keyword = keyword
			@action = action
		end

		def to_s
			"#{keyword} #{action}"
		end
		
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cukepages-0.0.4 lib/cukepages/feature.rb