Skip to content

Commit 4d7e03b

Browse files
committed
Remove Dockerfile.test
Trim Guardfile docs Add comment for live development to docker-compose.yml And add a few tests for node.rb
1 parent 63e81ee commit 4d7e03b

File tree

4 files changed

+35
-54
lines changed

4 files changed

+35
-54
lines changed

Dockerfile.test

Lines changed: 0 additions & 20 deletions
This file was deleted.

Guardfile

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,9 @@
1-
# A sample Guardfile
21
# More info at https://github.com/guard/guard#readme
32

4-
## Uncomment and set this to only include directories you want to watch
5-
# directories %w(app lib config test spec features) \
6-
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7-
8-
## Note: if you are using the `directories` clause above and you are not
9-
## watching the project directory ('.'), then you will want to move
10-
## the Guardfile to a watched dir and symlink it back, e.g.
11-
#
12-
# $ mkdir config
13-
# $ mv Guardfile config/
14-
# $ ln -s config/Guardfile .
15-
#
16-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17-
183
guard :minitest, all_after_pass: true do
194
# with Minitest::Unit
205
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
216
watch(%r{^test/(.*)\/?(.*)_test\.rb$})
227
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
238
watch(%r{^test/test_helper\.rb$}) { 'test' }
24-
25-
# with Minitest::Spec
26-
# watch(%r{^spec/(.*)_spec\.rb$})
27-
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
28-
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
29-
30-
# Rails 4
31-
# watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
32-
# watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
33-
# watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
34-
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
35-
# watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
36-
# watch(%r{^test/.+_test\.rb$})
37-
# watch(%r{^test/test_helper\.rb$}) { 'test' }
38-
39-
# Rails < 4
40-
# watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
41-
# watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
42-
# watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
439
end

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Continuous testing using guard:
2+
# docker-compose run -v $PWD:/tmp/src -w /tmp/src app bash -c 'bundle && guard'
13
version: '3.0'
24
services:
35
app: &app
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
require 'test_helper'
2+
3+
module LanguageServer
4+
class Project
5+
class NodeTest < Minitest::Test
6+
7+
def node_attributes
8+
{lineno: 1, character: 'a', path: nil}
9+
end
10+
11+
def test_node_attribute_names
12+
assert_equal(Node.attribute_names, [:lineno, :character, :path])
13+
end
14+
15+
def test_node_should_have_attributes
16+
attributes = node_attributes
17+
node = Node.new(attributes)
18+
assert_equal(node.attributes, attributes)
19+
end
20+
21+
def test_literal_value_attribute_names
22+
assert_equal(LiteralValue.attribute_names, [:lineno, :character, :path, :value])
23+
end
24+
25+
def literal_value_should_have_literal_value
26+
lv = :foo
27+
test_object = LiteralValue.new(node_attributes.merge(literal_value: lv))
28+
assert_equal(test_object.literal_value, lv)
29+
end
30+
31+
end
32+
end
33+
end

0 commit comments

Comments
 (0)