From e091a6bb1df14f29164b520b7bea59ea05402e65 Mon Sep 17 00:00:00 2001 From: Nick Christensen Date: Fri, 27 Apr 2012 10:18:01 -0400 Subject: [PATCH] initial --- test/spec/cmock_file_writer_spec.rb | 24 ++++++++++++++++++++++++ test/spec/spec_helper.rb | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/spec/cmock_file_writer_spec.rb create mode 100644 test/spec/spec_helper.rb diff --git a/test/spec/cmock_file_writer_spec.rb b/test/spec/cmock_file_writer_spec.rb new file mode 100644 index 0000000..7cceb0d --- /dev/null +++ b/test/spec/cmock_file_writer_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' +require 'cmock_file_writer' + +describe CMockFileWriter do + before do + @cmConfig = Object.new + #create instance of class under test + @subject = CMockFileWriter.new(@cmConfig) + end + + describe 'initialize' do + it "have set up internal accessors correctly on init" do + result = @subject.config + result.should == @cmConfig + end + end + + describe 'create_file' do + it "complain if a block was not specified when calling create" do + expect {@subject.create_file("text.txt")}.should raise_error + # should.be_false + end + end +end diff --git a/test/spec/spec_helper.rb b/test/spec/spec_helper.rb new file mode 100644 index 0000000..3899b5c --- /dev/null +++ b/test/spec/spec_helper.rb @@ -0,0 +1,12 @@ +require 'rubygems' + +proj_root = File.expand_path(File.dirname(__FILE__) + '/../..') +# require proj_root + '/config/environment' +$LOAD_PATH << proj_root + '/lib' + +require 'rspec' +require 'rr' + +RSpec.configure do |config| + config.mock_with :rr +end \ No newline at end of file