Sha256: 529e836097eabada83f02da72a6f89ed65378e8419cdb769bfdebe772ef399bc

Contents?: true

Size: 713 Bytes

Versions: 12

Compression:

Stored size: 713 Bytes

Contents

RSpec.describe Evil::Client::Formatter::Text do
  subject { described_class.call(source) }

  context "from file" do
    let(:source) do
      Tempfile.new(%w[hello .xml], encoding: "ascii-8bit").tap do |f|
        f.write "Hi!"
        f.rewind
      end
    end

    it "reads the file" do
      expect(subject).to eq "Hi!"
    end

    after do
      source.close
      source.unlink
    end
  end

  context "from a StringIO" do
    let(:source) { StringIO.new "Hello!" }

    it "reads the IO" do
      expect(subject).to eq "Hello!"
    end
  end

  context "from another source" do
    let(:source) { %i[2384] }

    it "stringifies the source" do
      expect(subject).to eq '[:"2384"]'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
evil-client-3.2.0 spec/unit/formatter/text_spec.rb
evil-client-3.1.0 spec/unit/formatter/text_spec.rb
evil-client-3.0.4 spec/unit/formatter/text_spec.rb
evil-client-3.0.3 spec/unit/formatter/text_spec.rb
evil-client-3.0.2 spec/unit/formatter/text_spec.rb
evil-client-3.0.1 spec/unit/formatter/text_spec.rb
evil-client-3.0.0 spec/unit/formatter/text_spec.rb
evil-client-2.1.1 spec/unit/formatter/text_spec.rb
evil-client-2.1.0 spec/unit/formatter/text_spec.rb
evil-client-2.0.0 spec/unit/formatter/text_spec.rb
evil-client-1.1.0 spec/unit/formatter/text_spec.rb
evil-client-1.0.0 spec/unit/formatter/text_spec.rb