<commit_before># Academic Benchmarks Ruby Library

_Brought to you by your friends at [Instructure](https://www.instructure.com/)_ :heart:

## Test Plan (Manual Testing)

There are many automated tests in the form of specs which can be run as follows:

    bundle exec rspec spec/

However, you may wish to verify functionality manually.  If so, here are some steps to verify this library.  You will need credentials (see README.md):


### Check authentication works properly and authorities list properly:

1. Pass-in credentials directly:

    ```
    ab_handle = AcademicBenchmarks::Api::Handle.new(partner_id: 'my-id', partner_key: 'my-key')
    ```

1. Now list authorities and make sure you get a list of authorities back.  What comes back will depend on your subscription.  For a sandbox it might look like this:

    ```
    ab_handle.standards.authorities
    {:code=>"IN", :guid=>"A8334A58-901A-11DF-A622-0C319DFF4B22", :description=>"Indiana"}
    {:code=>"CC", :guid=>"A83297F2-901A-11DF-A622-0C319DFF4B22", :description=>"NGA Center/CCSSO"}
    {:code=>"OH", :guid=>"A834F40C-901A-11DF-A622-0C319DFF4B22", :description=>"Ohio"}
    ```

1. Now put your credentials into environment variables.  If you use bash:

    ```
    export ACADEMIC_BENCHMARKS_PARTNER_ID='my-id'
    export ACADEMIC_BENCHMARKS_PARTNER_KEY='my-key'
    ```

1. Now instantiate and list authorities again, making sure to get the same thing back:

    ```
    ab_handle = AcademicBenchmarks::Api::Handle.init_from_env
    ab_handle.standards.authorities<commit_msg>Add environment initialization steps to manual test plan<commit_after># Academic Benchmarks Ruby Library

_Brought to you by your friends at [Instructure](https://www.instructure.com/)_ :heart:

## Test Plan (Manual Testing)

There are many automated tests in the form of specs which can be run as follows:

    bundle exec rspec spec/

However, you may wish to verify functionality manually.  If so, here are some steps to verify this library.  You will need credentials (see README.md):

### Install the current version of the gem and start up an interactive ruby console with the gem loaded:

1. First make sure no other versions of the gem are installed:

    ```
    gem uninstall academic_benchmarks
    ```

1. From the root directory of the project, build a new version of gem:

    ```
    gem build academic_benchmarks.gemspec
    ```

1. Now install the newly built gem, substituting the current version for <gem-ver> below:

    ```
    gem install academic_benchmarks-<gem-ver>.gem
    ```

1. Start up an interactive console and require the `academic_benchmarks` gem:

    ```
    $ irb
    irb(main):001:0> require 'academic_benchmarks'
    ```

### Check authentication works properly and authorities list properly:

1. Pass-in credentials directly:

    ```
    ab_handle = AcademicBenchmarks::Api::Handle.new(partner_id: 'my-id', partner_key: 'my-key')
    ```

1. Now list authorities and make sure you get a list of authorities back.  What comes back will depend on your subscription.  For a sandbox it might look like this:

    ```
    ab_handle.standards.authorities
    {:code=>"IN", :guid=>"A8334A58-901A-11DF-A622-0C319DFF4B22", :description=>"Indiana"}
    {:code=>"CC", :guid=>"A83297F2-901A-11DF-A622-0C319DFF4B22", :description=>"NGA Center/CCSSO"}
    {:code=>"OH", :guid=>"A834F40C-901A-11DF-A622-0C319DFF4B22", :description=>"Ohio"}
    ```

1. Now put your credentials into environment variables.  If you use bash:

    ```
    export ACADEMIC_BENCHMARKS_PARTNER_ID='my-id'
    export ACADEMIC_BENCHMARKS_PARTNER_KEY='my-key'
    ```

1. Now instantiate and list authorities again, making sure to get the same thing back:

    ```
    ab_handle = AcademicBenchmarks::Api::Handle.init_from_env
    ab_handle.standards.authorities
{'fraction_non_alphanumeric': 0.10574652322225138, 'fraction_numerical': 0.036735764891104694, 'mean_word_length': 4.062416998671979, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5120092', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1189, 'n_words': 396}