Sha256: 1974a1229727ce7c5ee42370687cdb54dfd9f09d12410e23baf5c4a92801d678

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Jsus::Util::Validator::Base do
  subject { described_class.new(pool) }
  let(:input_dir) { "spec/data/ChainDependencies/app/javascripts" }
  let!(:pool) { Jsus::Pool.new(input_dir) }
  context "initialization" do
    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
      described_class.new(pool.sources).source_files.should =~ pool.sources.to_a
    end

    it "should accept array as the first argument" do
      described_class.new(pool.sources.to_a).source_files.should =~ pool.sources.to_a
    end
  end

  it "should respond to #validate method" do
    subject.should respond_to(:validate)
  end

  describe ".validate" do
    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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jsus-0.3.6 spec/jsus/util/validator/base_spec.rb
jsus-0.3.5 spec/jsus/util/validator/base_spec.rb
jsus-0.3.4 spec/jsus/util/validator/base_spec.rb
jsus-0.3.3 spec/jsus/util/validator/base_spec.rb
jsus-0.3.2 spec/jsus/util/validator/base_spec.rb
jsus-0.3.1 spec/jsus/util/validator/base_spec.rb
jsus-0.3.0 spec/jsus/util/validator/base_spec.rb
jsus-0.2.7 spec/jsus/util/validator/base_spec.rb
jsus-0.2.6 spec/jsus/util/validator/base_spec.rb