spec/jsus/util/validator/base_spec.rb in jsus-0.3.6 vs spec/jsus/util/validator/base_spec.rb in jsus-0.4.0

- old
+ new

@@ -1,12 +1,13 @@ require 'spec_helper' describe Jsus::Util::Validator::Base do - subject { described_class.new(pool) } + it_should_behave_like "Jsus::Util::Mixins::OperatesOnSources" let(:input_dir) { "spec/data/ChainDependencies/app/javascripts" } let!(:pool) { Jsus::Pool.new(input_dir) } context "initialization" do + subject { described_class.new(pool) } it "should accept pool as the first argument" do described_class.new(pool).source_files.should =~ pool.sources.to_a end it "should accept container as the first argument" do @@ -21,13 +22,14 @@ it "should respond to #validate method" do subject.should respond_to(:validate) end describe ".validate" do + subject { described_class.new(pool) } it "should be the same as calling new + validate" do validator = mock described_class.should_receive(:new).with([1]).and_return(validator) validator.should_receive(:validate).and_return(true) described_class.validate([1]) end end -end \ No newline at end of file +end