Sha256: c48053ae463b3bdaa9508e03f332bc69c401f85ca1e60b30f92dc5db16d38117

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

require 'spec_helper'
require 'wlang/command'
module WLang
  describe "The examples", :hash_ordering => true do

    (root_folder/:examples).glob("**/*.*").each do |ex_file|
      next if ex_file.basename.to_s == "README.md"
      describe "the example file #{ex_file}" do

        let(:command) do
          cmd = WLang::Command.new
          def cmd.with_output(&proc); proc.call(""); end
          cmd
        end

        let(:expected) do
          from, to = root_folder, Path.dir
          (to/(ex_file % from)).rm_ext
        end

        it 'is instantiated as expected with autospacing' do
          got = command.run ["--auto-spacing", ex_file]
          got.should eq(expected.read)
        end

      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wlang-2.0.1 spec/integration/test_examples.rb
wlang-2.0.0 spec/integration/test_examples.rb