<commit_before># encoding: utf-8

$: << 'RspecTests/Generated/paging'

require 'rspec'
require 'paging'

include PagingModule

describe 'Paging' do
  before(:all) do
    @base_url = ENV['StubServerURI']

    dummyToken = '<PASSWORD>'
    @credentials = MsRest::TokenCredentials.new(dummyToken)

    @client = AutoRestPagingTestService.new(@credentials, @base_url)
  end

  # Paging happy path tests
  it 'should get single pages' do
    result = @client.paging.get_single_pages().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).to be_nil
  end

  it 'should get multiple pages' do
    result = @client.paging.get_multiple_pages().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  it 'should get multiple pages with offset' do
    result = @client.paging.get_multiple_pages_with_offset(100).value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_with_offset_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
    expect(result.body.values.last.properties.id).to eq (110)
  end

  it 'should get multiple pages retry first' do
    result = @client.paging.get_multiple_pages_retry_first().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_retry_first_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  it 'should get multiple pages retry second' do
    result = @client.paging.get_multiple_pages_retry_second().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_retry_second_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  # Paging sad path tests
  it 'should get single pages failure' do
    expect { @client.paging.get_single_pages_failure().value! }.to raise_exception(MsRest::HttpOperationError)
  end

  it 'should get multiple pages failure' do
    result = @client.paging.get_multiple_pages_failure().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    expect { @client.paging.get_multiple_pages_failure_next(result.body.next_link).value! }.to raise_exception(MsRest::HttpOperationError)
  end

  it 'should get multiple pages failure URI' do
    result = @client.paging.get_multiple_pages_failure_uri().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    expect { @client.paging.get_multiple_pages_failure_uri_next(result.body.next_link).value! }.to raise_exception(URI::Error)
  end
end<commit_msg>the uri test for validity would fail on the URI.parse<commit_after># encoding: utf-8

$: << 'RspecTests/Generated/paging'

require 'rspec'
require 'paging'

include PagingModule

describe 'Paging' do
  before(:all) do
    @base_url = ENV['StubServerURI']

    dummyToken = '<PASSWORD>'
    @credentials = MsRest::TokenCredentials.new(dummyToken)

    @client = AutoRestPagingTestService.new(@credentials, @base_url)
  end

  # Paging happy path tests
  it 'should get single pages' do
    result = @client.paging.get_single_pages().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).to be_nil
  end

  it 'should get multiple pages' do
    result = @client.paging.get_multiple_pages().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  it 'should get multiple pages with offset' do
    result = @client.paging.get_multiple_pages_with_offset(100).value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_with_offset_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
    expect(result.body.values.last.properties.id).to eq (110)
  end

  it 'should get multiple pages retry first' do
    result = @client.paging.get_multiple_pages_retry_first().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_retry_first_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  it 'should get multiple pages retry second' do
    result = @client.paging.get_multiple_pages_retry_second().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    count = 1
    while result.body.next_link != nil do
      result = @client.paging.get_multiple_pages_retry_second_next(result.body.next_link).value!
      count += 1
    end

    expect(count).to eq(10)
  end

  # Paging sad path tests
  it 'should get single pages failure' do
    expect { @client.paging.get_single_pages_failure().value! }.to raise_exception(MsRest::HttpOperationError)
  end

  it 'should get multiple pages failure' do
    result = @client.paging.get_multiple_pages_failure().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    expect { @client.paging.get_multiple_pages_failure_next(result.body.next_link).value! }.to raise_exception(MsRest::HttpOperationError)
  end

  it 'should get multiple pages failure URI' do
    result = @client.paging.get_multiple_pages_failure_uri().value!
    expect(result.response.status).to eq(200)
    expect(result.body.next_link).not_to be_nil

    expect { @client.paging.get_multiple_pages_failure_uri_next(result.body.next_link).value! }.to raise_exception(MsRest::HttpOperationError)
  end
end
{'fraction_non_alphanumeric': 0.10868893011750154, 'fraction_numerical': 0.013605442176870748, 'mean_word_length': 3.889644746787604, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5936567', 'n_tokens_mistral': 2214, 'n_tokens_neox': 2122, 'n_words': 426}