Sha256: 02da5ef6f481b3d57eb6abb2b198d7028ff5bc7d8d1763f902d5b2c3bf739a88

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 Bytes

Contents

require "spec_helper"
require "spec_helpers/mock_ncode_data_helper"

describe NcodeSyosetu::Client do
  include_context "with mock ncode data"

  let(:ncode) { "n00000" }

  describe "#get" do
    subject { NcodeSyosetu.client.get(ncode) }

    it "scrapes ncode novel" do
      expect(subject.toc.title).to eq("たいとる")
      expect(subject.episodes.size).to eq(4)
      expect(subject.episodes[0]).to be_a(NcodeSyosetu::Model::Heading)
      expect(subject.episodes[1]).to be_a(NcodeSyosetu::Model::Episode)
      expect(subject.episodes[1].number).to eq(1)
      expect(subject.episodes[2]).to be_a(NcodeSyosetu::Model::Heading)
      expect(subject.episodes[3]).to be_a(NcodeSyosetu::Model::Episode)
      expect(subject.episodes[3].number).to eq(2)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ncode-syosetu-0.0.7 spec/ncode_syosetu/client_spec.rb
ncode-syosetu-0.0.6 spec/ncode_syosetu/client_spec.rb