I followed the intro in the rspec page, and then added a test task to my rakefile to make a simple file read test:
#Rakefile
task default: %w[test]
task :test do
ruby "spec/file_reader_spec.rb"
end
#spec/file_reader_spec.rb
require './lib/filereader'
require 'rspec'
RSpec.describe "file_reader" do
context "with sample test input file" do
it "reads a file and prints its contents" do
@file_reader = FileReader.new
expect(@file_reader.input_file('./files/test_input.txt')).to eq ('file text')
end
end
end
But when I run the rake command, it outputs nothing, only one line showing that the spec file was executed:
$rake
/Users/mrisoli/.rvm/rubies/ruby-2.1.1/bin/ruby spec/file_reader_spec.rb
Why is it not outputing the test described?