Sha256: 42a9d3312922b7b4e74b2243b8deee430630d698dca635fda628707ebdbbc6fc

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

Given /^no task is active$/ do
  setup
end

When /^I start task "(.*)"$/ do |name|
  @logger.start(name)
end

Then /^I should see "([^\"]*)"$/ do |msg|
  @ui.msgs.should include(msg)
end

Given /^an active task "([^\"]*)"$/ do |task_name|
  setup
  
  @logger.start(task_name)
end

Given /^an active task "([^\"]*)" I worked on for (\d+) minutes$/ do |name, minutes|
  setup

  @logger.start(name)
  @timer.add_minutes(minutes.to_i)
end

Given /^an inactive task "([^\"]*)" I worked on for (\d+) minutes$/ do |name, minutes|
  setup

  @logger.start(name)
  @timer.add_minutes(minutes.to_i)
  @logger.stop(name)
end

When /^I do some work for (\d+) minutes$/ do |minutes|
  @timer.add_minutes(minutes.to_i)
end

When /^I stop task "([^\"]*)"$/ do |task_name|
  @logger.stop(task_name)
end

Given /^I worked on the following tasks:$/ do |table|
  setup

  table.hashes.each do |hash|
    name = hash["name"]
    minutes = hash["minutes"].to_i
    
    @logger.start(name)
    @timer.add_minutes(minutes)
    @logger.stop(name)
  end
end

When /^I list tasks$/ do
  @logger.list
end

def setup
  @ui = TimeLogger::UI.new
  @timer = TimeLogger::Timer.new
  @logger = TimeLogger::TimeLogger.new(@timer, @ui)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
TimeLogger-0.0.2 features/step_definitions/TimeLogger_steps.rb