Sha256: 33d197c05b3b32699fb97193f717a250ddd06f586fca9511ec4a6e9cbc87a7f8

Contents?: true

Size: 1.83 KB

Versions: 89

Compression:

Stored size: 1.83 KB

Contents

#
# Copyright 2012 Mortar Data Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'spec_helper'
require 'fakefs/spec_helpers'
require 'mortar/project'
require 'mortar/command/pigscripts'

module Mortar::Command
  describe PigScripts do
    
    # use FakeFS file system
    include FakeFS::SpecHelpers
    
    before(:each) do
      stub_core
    end
    
    context("index") do
      
      it "displays a message when no pigscripts found" do
        with_blank_project do |p|
          stderr, stdout = execute("pigscripts", p)
          stdout.should == <<-STDOUT
You have no pigscripts.
STDOUT
        end
      end
      
      it "displays list of 1 pigscript" do
        with_blank_project do |p|
          write_file(File.join(p.pigscripts_path, "my_script.pig"))
          stderr, stdout = execute("pigscripts", p)
          stdout.should == <<-STDOUT
=== pigscripts
pigscripts/my_script.pig

STDOUT
        end
      end
      
      it "displays list of multiple pigscripts" do
        with_blank_project do |p|
          write_file(File.join(p.pigscripts_path, "a_script.pig"))
          write_file(File.join(p.pigscripts_path, "b_script.pig"))
          stderr, stdout = execute("pigscripts", p)
          stdout.should == <<-STDOUT
=== pigscripts
pigscripts/a_script.pig
pigscripts/b_script.pig

STDOUT
        end
      end      
    end
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
mortar-0.15.53 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.52 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.51 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.50 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.49 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.48 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.47 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.46 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.45 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.44 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.43 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.42 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.41 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.40 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.39 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.38 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.37 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.36 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.35 spec/mortar/command/pigscripts_spec.rb
mortar-0.15.34 spec/mortar/command/pigscripts_spec.rb