Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 682 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 682 Bytes

Cspec

Running test cases via CSV

The goal of this project is to have a centralised location where all specs can be run

Quick start

  • Add this to your Gemfile
  gem 'cspec'
  • Create a CSV named specs.csv with the following spec
class,name,type,initialize_params_1,method,method_args_1,expected
MyClass,my test,,hello,,world
  • Create a file named my_csv_specs.rb to run the specs
require 'cspec'

# The implementation of the Ruby class being testedc
class MyClass
  def hello
    'world'
  end
end

# Running the specs
result = CSpec::Runner.run!("#{Dir.pwd}/specs.csv")
puts "Success: #{result}"
  • Run with ruby my_csv_specs.rb