mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -q -error -source=text {app,config,lib,test}/**/*
```
> workers = flag.Int("j", 0, "Number of workers, 0 = number of CPUs")
> writeit = flag.Bool("w", false, "Overwrite file with corrections (default is just to display)")
> quietFlag = flag.Bool("q", false, "Do not emit misspelling output")
> outFlag = flag.String("o", "stdout", "output file or [stderr|stdout|]")
> format = flag.String("f", "", "'csv', 'sqlite3' or custom Golang template for output")
> ignores = flag.String("i", "", "ignore the following corrections, comma separated")
> locale = flag.String("locale", "", "Correct spellings using locale perferances for US or UK. Default is to use a neutral variety of English. Setting locale to US will correct the British spelling of 'colour' to 'color'")
> mode = flag.String("source", "auto", "Source mode: auto=guess, go=golang source, text=plain or markdown-like text")
> debugFlag = flag.Bool("debug", false, "Debug matching, very slow")
> exitError = flag.Bool("error", false, "Exit with 2 if misspelling found")
23 lines
615 B
Ruby
23 lines
615 B
Ruby
require 'test_helper'
|
|
|
|
module ActiveModelSerializers
|
|
class JsonPointerTest < ActiveSupport::TestCase
|
|
def test_attribute_pointer
|
|
attribute_name = 'title'
|
|
pointer = ActiveModelSerializers::JsonPointer.new(:attribute, attribute_name)
|
|
assert_equal '/data/attributes/title', pointer
|
|
end
|
|
|
|
def test_primary_data_pointer
|
|
pointer = ActiveModelSerializers::JsonPointer.new(:primary_data)
|
|
assert_equal '/data', pointer
|
|
end
|
|
|
|
def test_unknown_data_pointer
|
|
assert_raises(TypeError) do
|
|
ActiveModelSerializers::JsonPointer.new(:unknown)
|
|
end
|
|
end
|
|
end
|
|
end
|