Sha256: 62008a546b73f49767d6f4617320c580d0d69bf4ee2be288791e642cc66ba6c2

Contents?: true

Size: 908 Bytes

Versions: 5

Compression:

Stored size: 908 Bytes

Contents

# -*- coding: utf-8 -*-
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")

describe CliJson do

  it "should accepts --help switch" do
    captured = capture_output do
      args = %w{--help}
      # args << File.join(FIXTURES, "test_dir_1")
      CliJson.new.parse_args(args)
    end
    captured.out.should match /Usage:/
  end

  it "should accept --version switch" do
    captured     = capture_output do
      args = %w{--version}
      CliJson.new.parse_args(args)
    end
    version = TreeRb::VERSION
    captured.out.should match version
  end

  it "should format simple json file" do
    captured = capture_output do
      args = []
      args << File.join(FIXTURES, "test_json", "1.json")
      CliJson.new.parse_args(args)
    end

    certified_out=<<-EOS
{
  "a": 1,
  "b": 2
}
EOS
    captured.out.should == certified_out
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tree.rb-0.3.11 spec/tree_rb/cli/cli_json_spec.rb
tree.rb-0.3.10 spec/tree_rb/cli/cli_json_spec.rb
tree.rb-0.3.9 spec/tree_rb/cli/cli_json_spec.rb
tree.rb-0.3.8 spec/tree_rb/cli/cli_json_spec.rb
tree.rb-0.3.7 spec/tree_rb/cli/cli_json_spec.rb