RubyValueProviderFactory implements ValueProviderFactory { @Override public ValueProvider newInstance(FolderEntry projectFolder) { return new RubyValueProvider(projectFolder); }  @Override ValueProvider newInstance(FolderEntry projectFolder); static final String RUBY_EXTESION; }
@Test public void testGetValuesWhenProjectContainsRubyFiles() throws Exception { Project rubyProject = pm.createProject(workspace, "rubyProject", new ProjectConfig("test project", "ruby", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = rubyProject.getBaseFolder(); baseFolder.createFile("test.rb", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = rubyValueProviderFactory.newInstance(baseFolder).getValues(HAS_RUBY_FILES); Assert.assertNotNull(values); Assert.assertFalse(values.isEmpty()); assertEquals(1, values.size()); }
@Test public void testGetValuesWhenProjectNotContainsPythonFiles() throws Exception { Project rubyProject = pm.createProject(workspace, "rubyProject", new ProjectConfig("test project", "ruby", new HashMap<>(), null, null, null), null, null); FolderEntry baseFolder = rubyProject.getBaseFolder(); FolderEntry firstFolder = baseFolder.createFolder("firstFolder"); FolderEntry secondFolder = baseFolder.createFolder("secondFolder"); firstFolder.createFile("test.txt", "test".getBytes(), MediaType.TEXT_PLAIN); secondFolder.createFile("test.java", "test".getBytes(), MediaType.TEXT_PLAIN); List<String> values = rubyValueProviderFactory.newInstance(baseFolder).getValues(HAS_RUBY_FILES); Assert.assertNotNull(values); Assert.assertTrue(values.isEmpty()); }